Windows

Schedule a restart operation with Windows XP's Shutdown utility

Wouldn't it be nice if each morning your Windows XP machine restarted before you got to work so you had a fresh system to work on each day? Greg Shultz tells you how to schedule a restart operation.

To help you automate this type of restart operation, Microsoft Windows XP comes with a command-line utility called Shutdown.exe, which can restart your system. To make this happen automatically, you can configure it to run at a specified time with the Scheduled Tasks tool. Here's how:

  1. Go to Control Panel | Scheduled Tasks.
  2. Double-click Add Scheduled Task to launch the Scheduled Task Wizard.
  3. Click Next and then click the Browse button.
  4. Access the Windows\System32 folder, select Shutdown.exe, and click Open.
  5. Follow the wizard through the next two screens to give the task a name and choose a schedule.
  6. Enter your user account name and password and click Next.
  7. Select the Open Advanced Properties check box and click Finish.
  8. In the task's Properties dialog box, add the /r parameter to the end of the command line in the Run text box and click OK. (Be sure to include a space between the last character in the command name and the first character in the parameter list.)
  9. Enter your user account name and password and click OK.

When the Shutdown utility runs, you'll momentarily see a small dialog box on your screen before the system restarts.

Note: This tip applies to both Windows XP Home and Professional editions.

Miss a tip?

Check out the Windows XP archive, and catch up on our most recent Windows XP tips.

Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

48 comments
onefocus99
onefocus99

I have many things open so that the next day I know where I'm at and I can just continue where I left off. Imagine someone clearing away everything you have off your table including important papers that were not yet finished etc. all nicely put away. How would you feel?

johnbarryy
johnbarryy

Golly Shucks, I just select the 'off' option when I go sleep

makaveli.armstrong
makaveli.armstrong

Hey this shit is cool man, I never knew this was possible its cool. two thumbs Up

roger
roger

There may be a decent tool out there, but the built-in Windows Shutdown.exe fits almost no one's need. Notice how many people added additional tweaks to make it better. It isn't just a restart you want, it's to save power, allow updates at convenient times and have the machine work on your schedule, not it's own. MS found this an easy tool to add, not a good one. And the real test: will your grandmother be able to use it? Hell no.

owen
owen

I have my backup program start shutdown.exe after it completes. I have a 10 min delay built in so a user can stop the shutdown if the are working late. All my clients have Dells so I use the bios on scheduler to boot the system according to the clients workweek then run ms updates. Below are the text for the cmd files. C:\i386\shutdown /s /f /t 600 /m \\"SystemName" /c "To cancel shutdown click on Stop Shutdown icon on desktop" C:\i386\shutdown /s /f /t 600 /m \\"SystemName" /c "To cancel shutdown click on Stop Shutdown icon on desktop" The stop command C:\i386\shutdown /a /m \\office01

AnswerMan
AnswerMan

Greg, Who needs all that?.... my way is more fun. Push the little "restart" button on the box, give back some rental coffee from the drive in, get a fresh coffee, schmooze with boss for fifteen seconds, make golf plans for later that week with Tony in the warehouse, hit on the gorgeous girl from accounting, and oogle the one from executive committee, return to desk... VIOLA' ..... a fresh system.... heheh. AM

reisen55
reisen55

I support a medical office, server, 16 stations and the staff NEVER LEARNED that terminating the primary patient management program at night was necessary for secure backups. I pleaded, screamed, made humor about it but they never got it. So I installed PC AUTOSHUTDOWN (which worked fine) until a new timecard program came in and it blew that up too. shutdown /s /f /t 2 Works great. I save it as a simple batch file: down.bat and schedule it to turn at 9:30 at night. Dell BIOS: I then schedule morning startups at 7:30 am with auto-signin permitted. Best of everything.

donrosco
donrosco

I can't help thinking the cheaper, safer, greener, better option is just shut it down when you're leaving...

lastchip
lastchip

Is there provision to shut-down on a Friday night and re-start Monday morning? I guess not, as presumably the system needs to remain in a "running" state to initiate the reboot. This would be far more useful for users that forget (or don't bother) to shut-down their machines at the end of the week.

onclejon
onclejon

A good tip but in my case the syntax is wrong and it would not work, will run with this syntax: "C:\WINDOWS\system32\shutdown.exe -r -t 00" without the quotes of course. John

mf19_4you
mf19_4you

Is there anybody that knows how you can create a .bat, or whatever, that you can use to shut down a Win 2003 Server (actually there are a few, but I guess is recursive)

Mark W. Kaelin
Mark W. Kaelin

Yes, this was originally an article, but it has never appeared in the Windows blog. I thought the article needed to be seen again in this blog.

reisen55
reisen55

If you EVER want to shutdown a system under remote control, THIS IS GREAT. Does it cleanly and neatly.

Mark W. Kaelin
Mark W. Kaelin

This tip works. This tip has also created a forum where other solutions can be suggested and real IT Professionals can offer their own variations on the theme. I'd say this little tip, as a body of work that includes the accompanying discussion thread, has accomplished plenty. And, I'm not sure the grandmother test is really applicable -- not really a novice consumer tip.

nshmakov
nshmakov

sorry, not your fault :)

bwilkes8
bwilkes8

I like what you have and would like to do the same thing; I'm new at this so would you please explain how to create the stop button you mention in your post?

roger
roger

this was about the poorest excuse for a windows "tip" I have ever seen. Your solution is what everone really does--especially the girl watching part.

tiredoftechrepublic
tiredoftechrepublic

"staff NEVER LEARNED that terminating the primary patient management program" Sounds like you needed to go to someone in your organization who understands HIPAA.

heathery1215
heathery1215

We have a .bat file run from my computer called by a schduled task, it writes a log and emails it to me so I know if there were any machines that didn't reboot properly. Works very well, a little tedious to set up since you need to list all the computers that you want to reboot but easy to mantain once in place. The .bat file looks like this: set output = %~dp0shutdown_log.txt Echo Shutting Down Computers... > %~dp0shutdown_log.txt Echo. >> %~dp0shutdown_log.txt ECHO [computername1] >> %~dp0shutdown_log.txt SHUTDOWN -m \\computername1 -f -r >> %~dp0shutdown_log.txt ECHO [computername2] >> %~dp0shutdown_log.txt SHUTDOWN -m \\computername2 -f -r >> %~dp0shutdown_log.txt Echo Process Complete. >> %~dp0shutdown_log.txt @START \\server\Notify\blat %~dp0shutdown_log.txt -to email@domain.com -subject "Shutdown Log" -priority 1 -server 192.x.x.x -f email@domain.com For details on the blat to notify by email see this site: http://support.discusware.com/center/resources/windows/blat.html

marc.d.williams
marc.d.williams

We have about 1,500 PC's. So that we can roll out patches, each Division has one night that they leave their machines on. The rest of the week (& weekends), PC's are turned off after normal business hours.

imahockeymom
imahockeymom

Instead of scheduling a task or leaving the computer off all night (I have our AV updates/scans scheduled for the evening hours so they don't drag down our puters during office hours), I just instructed everyone to reboot (not shutdown) their computer when they leave at night. This way they still have a "fresh" system in the morning, but the AV program was still able to update/scan during off hours.

fuscop
fuscop

Depends on the environment. Shutting it down when leaving will interfere with av scans, backups, updates and any other off-hours tasks in a corporate setting. At home I have used the shutdown command as a scheduled task for many years, originally copying it over to Win 2000 Pro from the server files.

steven.taylor
steven.taylor

We use a utility in PCTools to shut down all of our desktops at one hour after closing time and start them back up one hour after opening. We have not yet had a problem with Automitic Updates. This saves us several hours a day of having all those desktops running, using electicity and generating heat. Only exceptions of course are servers and IT administrator desktops.

tron
tron

Most Dell PC's have a Power On option in the bios. This might be an optin for Monday morning.

jltsale
jltsale

I would like to schedule a restart without needing a password. My computer starts up into a lighting control program that needs to run 24/7.

bob
bob

I've been able to schedule restarts just fine using the -r -t 00 syntax, but I was wondering if there is any way to schedule logging in once the reboot is complete.

francisvandenplas
francisvandenplas

but my advice is to leave out the "C:\WINDOWS\system32\" part of the command line. I know this is the correct syntax and I've been using this for quite some time as the last line of 2 batch/cmd files that perform a backup of the most recent data files, some settings, my favorites and "programs" folders as well as a tidy up of the Prefetch one and then shut down or restart the system. Funny thing is that often the command line would not execute at all. I recently left out the mentioned part and, bingo, everything runs as intended. Always infuriated by the idea of hitting a "Start" button to shut down the system, I created 2 icons, shortcuts to little cmd files executing this very same command (with the "-s" switch for the Shutdown), to perform this in one click out of the Taskbar part of my Quick Launch. This never worked until I... left out that same part of the command line!

tiredoftechrepublic
tiredoftechrepublic

Greg, Greg, Greg... There is a difference in forward slash and a hyphen. Please proof read and check your syntax before releasing tips to the public. Thanks to "onclejon"

ramannanda9
ramannanda9

I have made a simple tool that you can use its in java and can perform shutdown, standby, hibernate, restart, lock etc operations it has a inbuilt timer function with which you can easily set the time and choose the operation you can also abort the operation at any time. here's the link.

wesley.chin
wesley.chin

Just use to the task scheduler to trigger a restart. Make a shortcut with "%windir%\System32\shutdown.exe -r -t 00" in the target field of the shortcut properties. Use task scheduler to trigger that shortcut at a specified time.

tcunningham4
tcunningham4

The command is the same as XP shutdown /? will give you rht syntax.

roger
roger

the author must have had a deadline and was scraping the bottom

edglock21
edglock21

Most likely he has a shortcut pointing at a batch file containing the line shown in his post and named the shortcut "STOP Shutdown". Ed

reisen55
reisen55

I would agree withyou and believe me I tried every way to do it. I offered a training course, evening ... but getting them together was impossible. I tried an office champion but nobody wanted it. They are totally NICE people which makes it hard but when I used to walk into their office on evening time and found Eyecom2 running on 3 stations .... impossible. So I just had to take it under my own advisement to handle that myself and deal with the client on their own limitations. That is also the job of the consultant. ***** On HIPAA - Just take a look in the dumpster owned by Continuum Health Partners at the Secaucus NJ data center - inside a colleague found about 2000 patient records just thrown out. Not shredded, just tossed.

francisvandenplas
francisvandenplas

There is a nifty free utility to be had at www..nncron.ru that offers lots of options in task management and scheduling. It also carries several plugins to perform even more tasks. A scripting utility allows you to add your own.

tcunningham4
tcunningham4

Which utility are you talking about? I don't see anything obvious on their website for this. I would be interested to see how they power down and back up again...

lastchip
lastchip

So what are you suggesting? Close the PC down via schedule and re-start via BIOS? And if so, how do you initiate the BIOS option specifically for a time on Monday morning? Sadly, I don't have any Dell machines to experiment with, but it's well worth some discussion to float possible ideas.

ewingdweller
ewingdweller

Since WinXP now requires two Start -> Turn Off Computer tries (due to Norton AV?), I created a desktop shortcut to %windir%\system32\shutdown.exe -f -s -t 10 -c "bye" which shuts the system down after a short 10 second pause (-t 10) with the comment "bye". Think I got that here on TechRepublic; but not sure.

Photogenic Memory
Photogenic Memory

However; forward slashes are normal syntax under *nix systems. Although if you need to create a directory with a split name like "pron collection"; you'll use a backslash and a forward slash to separate the words and have the white space properly interpreted. For example: #mkdir pron\ collection/ = pron collection on the contrary with Windows DOS: >mkdir "Proof Read" = Proof Read Little stuff like this; although seemingly useless, can catch you in the boo-boo. And being condescending without being helpful is just plain stupid. Try to be a solution provider and not a pompous_IT_weenie before posting your comments to the public. Good day sir!

eyan1302
eyan1302

Hey, why have MCSE in your name, but not even know or bother to check yourself before flaming others that the - or / doesn't work... You are a disgrace to Microsoft, or better yet, strip yourself of the MCSE in your alias. Good day sir...

BTrik
BTrik

In Greg's defense, on my systems both slash and hyphen syntaxes work. Check yourself before posting . . .

rkuhn040172
rkuhn040172

I have found this to be very useful and very easy to implement. http://www.terranovum.com/projects/energystar/ez_gpo.html Ok, so it doesn't turn systems off and on but at least it does put them in a low power state saving power, money, and the environment. In addition, at a certain power level you can force the user to retype their password back in...sort of a security measure for the occasional idiot who not only forgets to power down over the weekend but also forgets to log off. I rolled it out 1 week ago and so far no problems. And it doesn't appear to be messing up our WSUS or Symantec updates since the PC's are just in low power mode and not all the way off.

lastchip
lastchip

But looking at a spare machine here, I can awake via a PCI card, or via a LAN call, or even Resume by alarm, but it only gives me one option; a specific date and time each month. What I'm looking for is a sort of calender event that can shut-down and re-start - Friday and Monday each week. Perhaps the Dells have that option, but I can't see it at the moment on this particular machine. With emphasis being placed on power management, it would be very good starting point to save some (possibly significant) power.

t.beckner
t.beckner

Since the late 1990's and modern Motherboards, most if not all Motherboard BIOS's have an option to restart/power-up on a schedule.