How to remote shutdown your Windows XP machine with a text message and Outlook
OK, I did this a while back to have more control over my computer when I am not at home. Keep in mind this method will turn off a computer with an “constant” internet connection i.e.(cable,DSL).
Basically you setup a rule in outlook to look for say a keyword in the subject line of an email. Then you select run application as the action for when that keyword is found. Then all you have to do is write a simple dos batch file and use the shutdown command with the -fs parameter to ensure the shutdown is not aborted by any running applications. After that the rest is simple you simply send a sms text message from your cell phone or other source to your email address. You must have automatic send and receive tunned on for this to work.
Ok so let’s get started.
Create a file called shutdown.bat in notepad with the following code in it.
shutdown -s
Save it to your C:\ drive so the path to the shutdown batch file is something like C:\scripts\shutdown.bat (Important this is a must the path must be exact) or you can modify the rule once you import it to point to the new destination it’s your call.
Now open outlook and adjust your settings to send and receive email every minute on the minute (1 minute for testing time can be increased if a delayed shutdown is desired.) now in Outlook in the file menu click Tools and select Rules and Alerts with the Rules and Alerts dialog open click the options button on the far upper right portion of the dialog window. Choose import rules from the options dialog and browse to the file C:\sms_functions\rules\shutdown.rwz
(the file was included in the downloaded project files) and your done. Now send a text message from your cell phone to your email address and in the subject use the key phrase smsshutdown%% (or make your own! :) and send it. When the email is received and found with the smsshutdown%% in the subject Outlook runs the dos batch file containing the shutdown -f command and shuts down your computer. You could also accomplish other task’s using this method using more dos commands, php scripts, perl what ever. This will work on Linux using pine also.
I hope this will be as useful to someone else as it has been to me.
Bonus Tip
I have found that this article explaining the MS-DOS SHUTDOWN Command Syntax can answer most of your questions about the command.
Update: I recently updated the file so it works the way it should thanks to everyone who helped in the comments. If you re download the files it should work for those of you whom it did not.
More Windows Automation Tips, Tricks and Software Also see my automation category for more Windows automation tips, tricks and software.
Instructions for creating your own RWZ files
- First open a notepad or other text editing program and type the following inside the file.
shutdown -fsc "SMS Remote Shutdown in progress..."
Save the file somewhere on your computer where it is easy to find. Something like say C:\sms_scripts\reboot.bat Also make sure your filename ends with the .bat extension so Windows knows it is an executable file.
- You will need to configure outlook with a rule to run when a speific keyword (mentioned above) is present in the subject line. To access the rules menu goto Tools > Rules and Alerts and create a new rule. Follow the setup wizard and create your rule and as an action select run program and navigate to your previously created batch file reboot.bat or whatever name you chose.
Once you have followed the above two steps send an sms text message to your computers email address “with Outlook running” and test it out. You should the text in the -c “text here” part of the batch file. This just explains to the user that the system is shutting down from and sms request. Have fun and enjoy this little trick.
Wednesday, May 10 May 10, 2006
It worked great, except for the fact that it only logged me out and didn’t shutdown the system. Could I possibly have some setting somewhere in Windows that is keeping it from shutting down completely?
Wednesday, May 10 May 10, 2006
This is cool!
It’s so simple, yet so useful … Thanks!
Wednesday, May 10 May 10, 2006
Wow, this will be really useful - I’m definitely going to use this, for both work and home. Now all I need is a way to wake a machine up at a prespecified time or signal…
Wednesday, May 10 May 10, 2006
That’s a pretty creative idea.
You don’t need pine on Linux, though.
You can just have some crontab that will check the mailbox periodically, and look for trigger words.
Wednesday, May 10 May 10, 2006
Ditto on the log off but no shut down.
Any Ideas?
Thanks in advance!
Wednesday, May 10 May 10, 2006
Try changing the batch file from “shutdown -f” to “shutdown -f -s”. That should fix the logoff problem.
Thursday, May 11 May 11, 2006
unfortuanly this will not work with HTTP mail, in HTTP mail you cannot set Rules and Alerts in Outlook, apparently it has to be POP3 or Exchange or some other type or protocal to work.
Thursday, May 11 May 11, 2006
You can wake a computer up remotely via:
http://gsd.di.uminho.pt/jpo/software/wakeonlan/mini-howto/
I know it’s not via sms message, it’s kind of predicated on being able to send magic packets
Thursday, May 11 May 11, 2006
Could this type of thing be done with Mozilla Thunderbird?
Thursday, May 11 May 11, 2006
I’ve never do this before but i’ll try it!!! Does it work in NTFS, DSL? In a public office just a network! would it work
Thursday, May 11 May 11, 2006
Useful, but you need to leave Outlook running all the time (I like logging off when not doing anything)
Also, anyone who knows your email address and the keyword can shutdown your PC :)
Thursday, May 11 May 11, 2006
You don’t even need cron in Linux, use procmail instead and it’ll shut your machine down instantly.
Tuesday, May 16 May 16, 2006
Hope you don’t have your work computer logged in too that’s hosting a Norton Ghost restore overnight, like I did :P
Thursday, May 18 May 18, 2006
It might be interesting to use a similar idea in the event you are fired, walk off a job, see your mug shot on tv, etc:
Send an email or call a friend to send - activating a delete profile, wipe, killdisk routine… Just in case!!
Monday, May 29 May 29, 2006
[...] Have you ever wanted to automate some of your more repetitive Windows or DOS tasks? Well now you can using a freeware tool called AutoIt. AutoIt is an easy to use automation program that allows you to convert EXE files to AutoIt scripts then launch the newly converted script. The power in this application lies within it’s ability to pass parameters to the script at run time. This software could be used in conjunction with my previous How to remote shutdown windows using a text message and outlook express . [...]
Monday, June 5 June 5, 2006
Is there any how we can shutdown using yahoo/msn chat messanger
Wednesday, August 2 August 2, 2006
This is an excellent tool, much thanks! I created a quick script to stop my bittorrent client from running, and another one to start it back again, I frequently need to access my FTP server here at home but the bittorrent client is hogging all the bandwidth, so I go to my web server and click on a button that runs a PHP script which executes the compiled scripts. Voila, on/off remotely! (I also have surveilance cams going, but these are useless to remote viewing when bittorrent is running.)
Simple and elegant. No spyware or virus that I can detect.
Wednesday, August 2 August 2, 2006
Oooops….
in above post I meant the AutoIT program, not the outlook trick, but this is also very slick…. I am running XAMPP server on my windows XP - Apache w/PHP, MySQL, & Filezilla FTP - on a Dynamic DNS setup - for my home DSL connection, running a couple personal web sites. I would try the outlook trick, but the web server can instantly execute the compiled scripts.
Once again, thanks for the tips! Very helpfull!
Sunday, October 22 October 22, 2006
Does it work in Outlook express???
Wednesday, January 10 January 10, 2007
Is there a way to run a file with a txt or an email? Is there a program that does this for you? please help Im dying to make this work…
Wednesday, January 31 January 31, 2007
for shutdown use SHUTDOWN -s and for restart use SHUTDOWN -r
Monday, February 5 February 5, 2007
I can’t get this to work at all - no matter what I do, Outlook doesn’t run the batch file. We have outlook tied to Exchange, but I’m leaving Outlook open, not the web browser with exchange. Is there something I need to set in Outlook security? Any ideas are appreciated…
Rich
Tuesday, February 13 February 13, 2007
@Rich follow drazen’s advice the file from this site actually has a typo in it and needs an amendment made to it. I have just been to busy to do it. Just edit the batch file to include shutdown -f -s and it should work. If it still does not work then you may need to contact your IT department to see if they have disabled something.
Best,
Tim Matheson
Thursday, March 1 March 1, 2007
Hi..
I am using outlook 2000. When i try to import C:\sms_functions\rules\shutdown.rwz file, it is giving error message — The file you are trying to import has an improper format. No rules were added.
Thanks,
Pal
Thursday, March 15 March 15, 2007
hey i am trying to make this but the pc doesnt turn off even when i click on the bat file it does nothing but runnig the “shutdown -f -s” all the time
but when i press in the command file “shutdown -f -s” the pc does turn off
i suspect this problem comes beacause of the xp and the lack of ms-dos support in it , am i righ or is it something else? whats the problem?? please help
thanks you
Thursday, March 15 March 15, 2007
@eli I have revised the script, please re download it and try it out. I apologize for not updating it sooner. I have just been really busy.
Best,
Tim Matheson
Friday, March 16 March 16, 2007
But… How can i send sms to my computer. this work in outlook but where do i have to send sms. How can i send sms to my email id. pls try to understand…..
thx in advance….
Friday, March 16 March 16, 2007
@Vishal, you need to point your sms message to your email account that outlook is downloading. Usually you just switch your phone into alpha mode and type in the address, but this may vary depending on your phone. I recommend you consult your carrier or cellphone documentation for further instruction.
Best,
Tim Matheson
Saturday, March 17 March 17, 2007
[...] read more | digg story [...]
Friday, March 30 March 30, 2007
This is pure brilliance!
So Simple yet so great!
Well done for this!
It will be up on my server before you can say “are we there yet?” (One for the parents!!)
Many thanks!
You could also customise the rule to start/stop any application on the remote machine.
Saturday, April 14 April 14, 2007
Hi Tim, great site!
FYI, the batch files are no longer available in your link/download.
Saturday, April 14 April 14, 2007
Try the link above it should work.http://www.timmatheson.com/downloads/howtos/sms_shutdown/sms_functions.zip
Sunday, April 29 April 29, 2007
Hi Tim, u r really cool…
hey i was not able to find any files inside the zip file,its just got no files in side,i tried ur link -> http://www.timmatheson.com/downloads/howtos/sms_shutdown/sms_functions.zip but still it has not no files inside the zip files, if u can upload the zip file again it wud b very much help, thanks for ur grt idea…
Friday, June 22 June 22, 2007
haha, ok - i found the files somewhere on the web and uploaded them to SD forum, where people were helping me get this to work…
http://i.slickdeals.net/attachment.php?attachmentid=42562&d=1182541246
Friday, June 22 June 22, 2007
edit: files here:
http://www.freefileupload.net/file.php?file=files/220607/1182541254/sms_functions.zip
Tuesday, July 10 July 10, 2007
Interesting…
Saturday, July 21 July 21, 2007
Same here Tim, the idea is awesome but the zip contains no files now…could we get them again somehow?
Tuesday, July 24 July 24, 2007
Same here Im not seeing anything in the zip file
Wednesday, July 25 July 25, 2007
The zip is empoty :-(
Wednesday, July 25 July 25, 2007
I found the zip here:
http://www.freefileupload.net/file.php?file=files/220607/1182541254/sms_functions.zip
but how do I create RWZ files so that I can make a few of these that run different batch files?
Tuesday, July 31 July 31, 2007
http://www.timmatheson.com - the Best site
Good day
Thank you, I will add it to my bookmarks
best regards
Nelson
Thursday, September 6 September 6, 2007
Hey why the files are not on the zip file ?
Wednesday, September 26 September 26, 2007
it wont work for me when i downloaded it and there is no files in it.
Tuesday, January 22 January 22, 2008
Hey everyone, if you don’t have a data plan (like me, poor college kid) but you still want to send an email or sms to your outlook to control something you can do something like this:
Most carries have some sort of sms to email gateway. This means you send a text sms message to a special number (In my case, I use ATT, I send a message to “111″). Just like your sending in a text with certain text to get some silly promo thing off the tv.
The only thing is you need to know is that most of these gateways have a particular format you need to follow. For instance, (again ATT/cingular), I have to format my message so that it reads “addres_Im_Sending_to@wherever (whatever I want in the subject line) body of email”.
In our case for the rules script stuff, you would send something like “yourEmail@somewhere.net (special password whatever)” Note, no real point in a body text.
Hope that helps! Took me a few to find the info, but check out wikipedia http://en.wikipedia.org/wiki/SMS_gateways
Leave a Comment
You must be logged in to post a comment.