How To Automatically Shut Down Your Windows XP Computer

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.


{ 83 comments… read them below or add one }

51 Maurice Arney 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.

52 Gary G. Nyman, Sr. 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.

53 Gary 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.


54 Bill July 18, 2011 at 9:59 am

Gary » Cool beans. Good luck.

55 John August 8, 2011 at 5:11 am

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

56 John 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.

57 Bill August 10, 2011 at 6:59 pm

John » Glad to hear it John.

58 Bill August 10, 2011 at 6:59 pm

John » Good add.

59 Jenny 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?

60 Kris 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.

61 Bill September 4, 2011 at 6:10 pm

Kris » Thanks Kris, great to hear.

62 Saraiva September 12, 2011 at 10:09 pm

Very good. Does it work in Windows 7?

63 Bill September 12, 2011 at 10:45 pm
64 Carl 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

65 Mark 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?

66 Imran December 10, 2011 at 11:44 am

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

67 Ida 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!

68 James 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.

69 Bill March 25, 2012 at 4:18 pm

James » Thanks James, excellent tip.

70 Elizabeth 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?

71 Bill June 4, 2012 at 4:17 pm

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

72 Da Oansa 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.

73 Bill June 13, 2012 at 7:58 am

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

74 Sarfraz 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.

75 Bill June 18, 2012 at 5:56 am

Sarfraz » Thanks Sarfraz.

76 Saim Wilson June 23, 2012 at 9:07 am


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


77 Vishwambhar June 28, 2012 at 8:44 am

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

78 BruzeW 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 0×80070005 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.

79 Bill September 24, 2012 at 4:17 pm

BruzeW » Good stuff, thanks.

80 Kotik 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!!!

81 amji waheed January 29, 2013 at 10:10 pm

it works thank you.

82 jafar 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

83 Dusty August 3, 2013 at 6:57 am

jafar, I think the period you referenced actually marked the end of the sentence in the instructions and should not be included in the actual command.

Leave a Comment

Comment Policy: Please leave the best comment you can. Comments like, "Hey Nice Post" or comments that have been automated and make no sense, will be deleted. Feel free to argue when necessary, but no name calling. They will be edited out. I appreciate it and others will too.

Another great thing to do is leave your real name and not your company name in the name field.

Want to write a Guest Post for The Spinning Donut? Check out the Guest Post Guidelines here.

{ 7 trackbacks }

Previous post:

Next post: