• Skip to main content
  • Skip to primary sidebar
  • Newsletter
  • Contact
  • About

The Spinning Donut

Helping People Use Technology

How To Automatically Shut Down Your Windows XP Computer

December 25, 2007 By Bill 89 Comments

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 without some kind of external shutdown clock program for XP.

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.

Scheduled Tasks

2. Click “Next” on the “Schedule Task Wizard” screen (below).

Windows XP Schedule a Task Wizard

3. Click the “Browse” button on the next screen that lists the different applications you can select from (below).

Windows XP Schedule a Task Wizard

4. Browse to C:\Windows\system32 and select the program shutdown.exe (below).

Windows XP Schedule a Task Wizard

5. After selecting shutdown.exe, select “Daily” for “Perform this task:” (below).

Windows XP Schedule a Task Wizard

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.

Windows XP Schedule a Task Wizard

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.

Windows XP Schedule a Task Wizard

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).

Windows XP Schedule a Task Wizard

9. You’ll be presented with the following screen.

Windows XP Schedule a Task Wizard

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”.

Windows XP Schedule a Task Wizard

11. There’s nothing to change on “Schedule” tab. However, feel free to adjust anything that pertains to your work environment or routine.

Windows XP Schedule a Task Wizard

12. I also leave the “Settings” tab alone. Again, change what you need to or experiment what suits your work style.

Windows XP Schedule a Task Wizard

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.

Windows XP Schedule a Task Wizard

That’s it!! Now you can rest assured your PC is shut down and secure while you’re away from your PC.

Filed Under: Microsoft Windows

Reader Interactions

Comments

  1. Chaksha says

    March 20, 2011 at 5:30 pm

    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 :
    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 🙁 my system runs Windows XP SP 3.

  2. David says

    July 3, 2011 at 4:00 pm

    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……….

  3. Vin says

    July 8, 2011 at 5:19 am

    Big help. Thank you!

  4. Bill says

    July 8, 2011 at 10:48 am

    Vin » Good to hear Vin.

  5. Gary G. Nyman, Sr. says

    July 12, 2011 at 3:09 pm

    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)

  6. Bill says

    July 12, 2011 at 8:34 pm

    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.

  7. Maurice Arney says

    July 13, 2011 at 6:54 am

    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.

  8. Gary G. Nyman, Sr. says

    July 13, 2011 at 7:12 pm

    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.

  9. Gary says

    July 16, 2011 at 9:52 pm

    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

  10. Bill says

    July 18, 2011 at 9:59 am

    Gary » Cool beans. Good luck.

  11. John says

    August 8, 2011 at 5:11 am

    Thank You! Thank You! Thank You! That “-f” saved my day.

  12. John says

    August 8, 2011 at 5:48 am

    P.S.: If you ever need to abort the shutdown operation just open a Run… prompt (Win + R), type “shutdown -a” and press ENTER.

  13. Bill says

    August 10, 2011 at 6:59 pm

    John » Glad to hear it John.

  14. Bill says

    August 10, 2011 at 6:59 pm

    John » Good add.

  15. Jenny says

    August 22, 2011 at 11:00 am

    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?

  16. Kris says

    September 4, 2011 at 6:08 pm

    I also had the same issue as Andrea, Gary, and Jenny. I got it to work by replacing “-s” with “/s” and so on.

  17. Bill says

    September 4, 2011 at 6:10 pm

    Kris » Thanks Kris, great to hear.

  18. Saraiva says

    September 12, 2011 at 10:09 pm

    Very good. Does it work in Windows 7?

  19. Bill says

    September 12, 2011 at 10:45 pm

    Saraiva » Yes – How To Automatically Shut Down Your Windows 7 Computer

  20. Carl says

    September 26, 2011 at 3:57 pm

    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

  21. Mark says

    November 19, 2011 at 8:03 am

    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?

  22. Imran says

    December 10, 2011 at 11:44 am

    Hey thanks dude! That was great and it worked perfectly.

  23. Ida says

    January 27, 2012 at 10:22 am

    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!

  24. James says

    March 25, 2012 at 6:11 am

    Most BIOS will have the option of tuning your computer ON. Press F2 while your computer is booting and it will enter “setup”. Browse around in there and you can find the setting to automatically turn it on.

  25. Bill says

    March 25, 2012 at 4:18 pm

    James » Thanks James, excellent tip.

  26. Elizabeth says

    June 3, 2012 at 6:37 pm

    Is there any way to save it onto the settings or anything more permanent? I work at a library and need this program but they all get wiped every night so it’s impossible for patrons to save personal information. the down side to that is that I can’t save this onto the desktops. Help?

  27. Bill says

    June 4, 2012 at 4:17 pm

    Elizabeth » Hi Elizabeth. Does that mean you do or don’t control the desktops at the library?

  28. Da Oansa says

    June 9, 2012 at 5:22 am

    I think I found the reason, why some people here experience troubles using your command. It is the Blank within the Comment!

    The Solution is: -c “DailyShutdown” (without any blank!)

    Don’t know, whether this is a bug within shutdown.exe.

    I am using XP Prof. SP 3.

  29. Bill says

    June 13, 2012 at 7:58 am

    Da Oansa » Good find Da. I’ll have to test this.

  30. Sarfraz says

    June 17, 2012 at 2:54 pm

    the above information is really very helpfull..but some may be facing a problem, that nothing happen only a DOS screen appears.
    Solution to that is:
    just remove the space between the words (instead place underscore) in comment.
    It should be like this:
    C:\WINDOWS\system32\shutdown.exe -s -t 60 -c “_Daily_Shutdown_” -f

    if you are having the problem about admin previliges just check the check box “Run only if i logged on” in properties of the sheduled task.

  31. Bill says

    June 18, 2012 at 5:56 am

    Sarfraz » Thanks Sarfraz.

  32. Saim Wilson says

    June 23, 2012 at 9:07 am

    Hi,

    I want a scheduled auto log off when PC is lock in windows XP SP3.
    Kindly suggest.

    Thanks,
    Saim

  33. Vishwambhar says

    June 28, 2012 at 8:44 am

    Do we have any external applications which can be used to shut down a pc automatically?

  34. BruzeW says

    September 24, 2012 at 2:22 pm

    My XP computers are auto logon with administrated rights (no password) and because of this I too get the dreaded 0x80070005 access error when I try this. The following worked for me on 2 different OEM XP pro computers.
    Click Start, Run and type Gpedit.msc to bring up the Group Policy editor. In the Local Computer Policy list, expand Computer Configuration, Windows Settings, Security Settings, Local Policies, Security Options, then double click “Accounts: Limit local account use of blank passwords to console logon only”
    Select “Disable” and Apply.
    This will now allow scheduled program access when you add any new programs in scheduled tasks.

    Here is my disclaimer; Although this worked for me I am not responsible for its effectiveness or security on anyone else’s systems. The setting change appears to me to be innocuous for all my intents and purposes.
    Try it if you are like me (and 50% of the rest of the world) and have a system that you want to just skip logon and start windows when you turn the damn thing on. Cheers.

  35. Bill says

    September 24, 2012 at 4:17 pm

    BruzeW » Good stuff, thanks.

  36. Kotik says

    December 30, 2012 at 12:09 am

    Thankyou for this post and video on youtube. I was very annoyed when i wake up that my pc is running, now before i watch movie in evening in bed, i can put auto shutdown to turn off my pc:) Also -f command helps if i have many videos in row and when i’m asleep my videos are still playing. Thanks again!!!

  37. amji waheed says

    January 29, 2013 at 10:10 pm

    it works thank you.

  38. jafar says

    July 31, 2013 at 9:39 pm

    Sorry to say that your line C:\Windows\system32\shutdown.exe -s -t 60 -c “Daily Shutdown” -f.does not work but as i replaced“Daily Shutdown” with “Daily Shutdown” .it started to work.Note that error is ” .please correct it for any new comer.Thanks

« Older Comments

Trackbacks

  1. Dusting off old tech: Setting a daily unattended FM recording | FM DXing says:
    April 14, 2014 at 8:28 am

    […] to ensure the computer switches off after recording. Blogger the Spinning Donut has a step-by-step guide and video for […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Get Exclusive
Tech Tips

Learn tech topics
with exclusive tips and insights
that I only share with my private
newsletter subscribers.

Popular YouTube Videos

  • An Introduction to Ubuntu 8.04 (over 50,000 views)
  • Running Self-Hosted WordPress - 1 of 3
  • Running Self-Hosted WordPress - 2 of 3
  • Running Self-Hosted WordPress - 3 of 3

Subscribe to my YouTube Channel


YouTube Channel

Categories

Copyright © 2025 · Privacy Policy and Disclaimer · Hosting by HostGator