It’s been said, “Not owning a computer is the most secure computer.” While that’s true, we need to take steps to keep our computer secure.
As a general rule, I like to shut my computer off when I’m away from it for long periods of time. That includes going out for the day or night, as well as going to sleep. Sometimes it’s hard to remember to shut it off. So in this article I’ll show you a way to shut your Windows XP computer off automatically.
Windows XP comes with a program called shutdown.exe and is located in your system32 folder which typically resides under C:\Windows or the main folder where Windows XP was installed.
So let’s set this up quickly:
1. Go to “Start->Control Panel” and click on “Scheduled Tasks” if you’re in “Classic View”. If you’re not in “Classic View” you are probably in “Category View”. In “Category View” you’ll click on “Performance and Maintenance”. Then click on “Scheduled Tasks”. You’ll see the following screen. Double-click the “Add Scheduled Task” icon.
2. Click “Next” on the “Schedule Task Wizard” screen (below).
3. Click the “Browse” button on the next screen that lists the different applications you can select from (below).
4. Browse to C:\Windows\system32 and select the program shutdown.exe (below).
5. After selecting shutdown.exe, select “Daily” for “Perform this task:” (below).
6. I sleep during the night. That’s why I shut my PC down automagically at 3:00am (below). But, I run some jobs automatically at 1:00am – virus scan and spyware scan, which will be part of a future article. Feel free to adjust this time to fit your schedule.
7. You’ll be asked to provide a user name and password that will be used to run this task (below). Warning: If you don’t know your password, that ok. You can add or change it later. If you don’t provide the correct password, you’ll get an error screen after this step. However, you’ll still be able to finish this process.
8. At this point you’ve successfully added a new schedule task to run at 3:00am. However, let’s click on the “Open advanced properties fro this task when I click Finish” checkbox and click “Finish” so we can add some command line parameters to shutdown.exe (below).
9. You’ll be presented with the following screen.
10. Add the following command line parameters as seen below and here – C:\Windows\system32\shutdown.exe -s -t 60 -c “Daily Shutdown” -f. The -s stands for “Shutdown the computer”. The -t 60 stands for “Set timeout for shudown to xx seconds. Feel free to adjust that. You never know when you’re going to be working at 3:00am, so it’s nice to have 60 seconds to prepare for the shutdown. The -c stands “Shutdown comment” which shows up on the screen when the PC is shutting down. And finally the -f stands for “Forces running applications to close without warning”.
11. There’s nothing to change on “Schedule” tab. However, feel free to adjust anything that pertains to your work environment or routine.
12. I also leave the “Settings” tab alone. Again, change what you need to or experiment what suits your work style.
13. This is the final screen (below) that pops up when the task runs. You will have 60 seconds to close applications if you need to.
That’s it!! Now you can rest assured your PC is shut down and secure while you’re away from your PC.


















{ 77 comments… read them below or add one }
← Previous Comments
Hey these are great Tips – thanks. I’m an IT guy and I’m embarrased to say I wasn’t aware of this, am sharing with my team now – thanks!!!
Jason
Improve Vertical leaping recently posted..Improve Vertical Leaping with the Jump Manual
Hi Bill,
I’m trying to implement this at my job. It works on my computer, but not others. On some of the computers the shutdown.exe pops up, disappears, and nothing happens. I have done a virus scan on all of the computers with MS Security Essentials. On other computers I get a 0×80040005 Access is Denied. You do not have permission. All the computers have 2 user accounts on them. One limited and the other is an admin account. When I set the schedule tasks option, I am running it in the limited account with the admin name and password.
What am I doing wrong?
I tried to set this particular scheduled task as per the instructions but as soon as i click finish & exit the Scheduled Task Wizard I get an error :
my system runs Windows XP SP 3.
A new task has been created but may not run because the account information could not be set.
the specific error is : 0X80070005. Access is denied.
can anyone please please help me?? i really need this task scheduled
Thanks for this article! I’m a 15 year old and I am working on setting up my home network which so far has gone pretty smoothly. I set up wireless printing and network drives. But I needed the computer to shut off after a certain time so it wouldn’t waste power. This was pretty easy for me actually. But if My mom did this, she would be all over the place……….
Big help. Thank you!
Vin » Good to hear Vin.
I have tried and re-tried your above process for shutting down my PC’s. In this particular case, it’s Windows XP, SP3. Following your directions to the tee (“http://www.thespinningdonut.com/how-to-automatically-shut-down-your-windows-xp-computer/”), all that happens is a flash of a “DOS” screen, and then nothing? This same thing happens with my Windows Vista. Has something changed since you wrote these articles? Thanks for your time and help. (Screen below)
C:\>cd windows
C:\WINDOWS>cd system32
C:\WINDOWS\system32>C:\WINDOWS\system32\shutdown.exe -s -t 60 -c “Daily Shutdown
” -f
Usage: C:\WINDOWS\system32\shutdown.exe [-i | -l | -s | -r | -a] [-f] [-m \\comp
utername] [-t xx] [-c "comment"] [-d up:xx:yy]
No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c “comment” Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without war
ning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer le
ss than 256)
yy is the minor reason code (positive integer le
ss than 65536)
Gary G. Nyman, Sr. » Hi Gary, That rings a bell, I just can’t remember why it would happen. Have you looked at this link for Vista: How To Automatically Shutdown Your Windows Vista Computer
Also, you might want to take a look at your system event log file, maybe there is something getting recorded in there when the command runs. The event log might show more info for why it’s not running successfully.
Nothing has changed since the articles were written. It should work with XP at least. See the link above for Vista and there’s even one for Windows 7 you can find in the popular posts list on the sidebar.
Let us know.
Gary G. Nyman, Sr…. Gary, I would suggest trouble shooting from a command prompt (Start>run>cmd). Try entering the shutdown.exe command alone and then add each argument one at a time to which one is the culprit. I would also try enclosing the comment in two sets of quotes to see if that helps. I have had to do this in the past with comment strings that include a space. Let us know how you make out.
C:\WINDOWS\system32>C:\WINDOWS\system32\shutdown.exe -s
The above works just fine, both from “cmd” and Task Scheduler. Thanks ever so much for the prompt response and your help. I should probably note that the person “requesting” the shutdown is my login, with a password, which is required when I sey up the task. I have Administrative priviliges.
A bit of clarification on the autoshutdown I posted earlier (C:\WINDOWS\system32>C:\WINDOWS\system32\shutdown.exe -s)
The above works just fine, both from “cmd” and Task Scheduler. I ran the program from Task Scheduler as “Run Program” and it worked, however it is not working by itself at the scheduled time, 2:00am. I’m going to add “-f” and see if that will do it.
Gary
Gary » Cool beans. Good luck.
WOW, Didn’t even know this was possible, Thanks for sharing this great tip
Thank You! Thank You! Thank You! That “-f” saved my day.
P.S.: If you ever need to abort the shutdown operation just open a Run… prompt (Win + R), type “shutdown -a” and press ENTER.
John » Glad to hear it John.
John » Good add.
I’m having the same issue as Andrea and Gary, and I suspect it’s because my user doesn’t have Admin privileges. Can someone confirm?
I also had the same issue as Andrea, Gary, and Jenny. I got it to work by replacing “-s” with “/s” and so on.
Kris » Thanks Kris, great to hear.
Very good. Does it work in Windows 7?
Saraiva » Yes – How To Automatically Shut Down Your Windows 7 Computer
Nice article… not that I leave my system on for long periods unwatched, If I ever need to I now know how to get it to turn itself off… You wouldnt have a tip to get it to turn itself on….lol
Well this is really informative update.. and i would also recommend http://microsoftsupportnow.com/2011/repair-windows-xp-with-microsoft-support/ for anyone looking for more info on this..
This would have been useful if only I kept Windows XP running on my laptop, any idea if it is possible to to the same with Windows Seven? or I will need a specific software for this purpose?
Hey thanks dude! That was great and it worked perfectly.
Very good article! I can´t seem to find that “Performance and Maintenance”-button, though. I´m using a Danish computer and I´m working hard to figure out what the Danish expression would be. A little embarassing!
← Previous Comments
{ 31 trackbacks }