Faster Shutdowns Using the Run Dialog
Posted by Kyle Pott at 12:00 AM on December 16, 2007
Reader Eric writes in with a tip to eliminate hangs and speed up the shutdown process in Windows without installing any extra software.
Whenever I tried to shutdown my work laptop it would take almost five minutes. Five minutes! Since I work in a completely locked-down environment I couldn't look to any third party applications for help. Entering the following shutdown command in the run dialog speeds up my shutdown time dramatically.The command Eric uses immediately forces any open applications to close without warning prior to Windows shutting down. Here's another way to quickly shutdown your Windows computer. Thanks, Eric!
shutdown -f -t 0

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
Bob Brown
Posted 2:06 PM 15/12/07
I guess I never shutdown without first closing all the windows unless it is an emergency (one program horribly crashes, and usually the same odd program).
I did have an old laptop with shutdown issues, but it turned out to be hardware based.
Bob Brown
Johnay
Posted 1:36 PM 15/12/07
IRMAK is right. There's no telling what garbage your programs are leaving behind if forced to end abrubtly. I've applied the patch linked to in her post and it's made a world of difference.
I also find it's actually faster to close my apps one at a time manually before shutting down. Having them all do their cleanup of temp files, etc. at once makes for a lot of time-consuming disk access contention.
Johnay
Victor V.
Posted 12:23 PM 15/12/07
[b]shutdown -c[/b] "Message here" displays a message in the shutdown dialog.
Victor V.
Rob P.
Posted 12:20 PM 15/12/07
@alekc: shutdown -s shuts down the computer. shutdown -a aborts a shutdown, but only if you have previously used shudown -t X, where X > 0. In other words, if the shutdown has already commenced then you're SOL.
Rob P.
xnendron
Posted 12:11 PM 15/12/07
@irmak: I gotta agree. Forcing apps and windows to close without going through the normal shutdown procedures seems like a recipe for disaster to me. In an emergency, sure, but it shouldn't be the norm.
xnendron
arctanck
Posted 11:21 AM 15/12/07
I need to try this on my PC at work on Monday. What really annoys me is the Adobe Reader which always prevents me from cleanly shutting down my PC. I certainly hope this line of command will speed up the shutdown process for me!
arctanck
EracMan
Posted 10:57 AM 15/12/07
I have created shortcuts in the past for restarts and logoffs and put then on the desktop when I am remoted in a workstation pc (not a server) via RDP. I do this because when you are remoted into a workstation via rdp, the option to restart/logoff is not readily available from the start menu, just disconnect.
Also in keeping with this, I have the power button on my work PC set to hibernate. When 5pm hits, I push the button and leave. No need to shut down programs or do the whole start menu thing. Of course my work PC is not as neutered so I can do these things without issue.
EracMan
alekc
Posted 10:35 AM 15/12/07
btw there are 2 useful switch
-r reboot pc
-s stop it
alekc
Swirlee
Posted 10:33 AM 15/12/07
You can also hibernate or restart with the same command. /h for hibernate and /r for restart (I find it curious that this command seems to accept Unix-style in place of the standard Windows slashes). There's lots of other options, too--use the /? switch to see them, of course.
Swirlee
Victor V.
Posted 9:38 AM 15/12/07
@uncballzer: Er... press the shutdown button?
Victor V.
uncballzer
Posted 9:32 AM 15/12/07
I love the shortcut method--i've got that set up for hibernation as well, and with out favorite program Launchy; I don't even remember or want to know what I used to do to shutdown.
uncballzer
irmak
Posted 9:29 AM 15/12/07
I don't think it would be a good idea to regularly force applications to close.
The user profile hive cleanup service is a good way of decreasing shutdown times:
[www.microsoft.com]
irmak
Bob Brown
Posted 9:17 AM 15/12/07
You could create that as a shortcut, but then on a completely locked down system you probably couldn't do that.
Hopefully a fully locked down system wouldn't have shutdown problems, and if it does you could call your IT department or just hold the power button for 5 seconds.
Bob Brown
Johnny Pneumatic
Posted 9:13 AM 15/12/07
If you prefer hibernation, this is the (unintuitive) command I found:
rundll32.exe PowrProf.dll, SetSuspendState
Hibernation doesn't bother shutting any programs down, just copies their current state to memory. It drastically reduces my power cycling time, but your mileage may vary.
Btw: these commands are great for dropping into a one line batch script. I keep little scripts like that in an indexed subdirectory in my Launchy folder, so I can usually hibernate with alt+space, h, Enter.
Johnny Pneumatic
joemoma
Posted 8:56 AM 15/12/07
working in a "completely locked down environment" would likely mean that your IT department would have disabled the command prompt.
joemoma
Miyabi
Posted 8:23 AM 15/12/07
I actually got this tip from LH quite a while back; it's probably my favourite. And you can change the time until shutdown if you're downloading something or want to delay it for whatever reason by changing the 0 to any number of seconds; I find it really useful at times.
Miyabi
Victor V.
Posted 8:09 AM 15/12/07
That's because -f stands for forced. It forces all programs to close, so it shuts down faster.
Victor V.
chaos421
Posted 4:35 PM 15/12/07
aww hell just flip off the power strip switch.
chaos421
pdok
Posted 4:10 PM 15/12/07
For those of you on locked down PCs at work, try creating a batch file with the "tskill" command to kill any of the processes over which you have control.
The adobe process that runs at startup is a prime culprit, along with a host of "helpful" icons, DVD launchers, etc.
I put this batch file in the startup folder and it runs at the end of the series of startups.
tskill jusched
tskill banner
tskill igfxtray
tskill athocgov
tskill dvdlauncher
etc...
Just put in the stuff you find under Processes in the task manager and experiment on what you can kill from the command line first.
This eliminates quite a bit of fluff after startup
pdok
war59312
Posted 9:31 PM 15/12/07
Hi,
I got an even easier way. :D
Download:
[rapidshare.com]
Uses standard windows API to shutdown, reboot, and logoff. :)
RB.exe is for rebooting, LO.exe, if for logging off, while SD.exe is for shutdowning.
No warning so when you run it will do just that. Does not force either so its perfectly save. I use all the time.
For best results place the three files in %systemroot%\system32\ and import this registry tweak:
Windows Registry Editor Version 5.00
;Adds LogOff to right click of MY Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\[Log Off]\command]
@="LO.exe"
;Adds Reboot to right click of MY Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\[Reboot]\command]
@="RB.exe"
;Adds Shutdown to right click of MY Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\[Shut Down]\command]
@="SD.exe"
So now you can Logoff, reboot, and shutdown all from the context menu (right click) of my computer. :)
Enjoy,
Will
war59312
lm
Posted 11:39 PM 15/12/07
"shutdown -f" is an incredibly bad idea to use for general shutdowns, because it forces all programs to stop immediately, whether it's doing anything for not. This can lead to severe loss of data and severe data corruption. It will even force parts of windows to quit without finishing anything. I bet after a week of -f, if you run chkdsk, it'll have a frenzy. -f is for if you have a really stubborn process that won't quit, even for shutdown. Take out the -f. Please.
lm
Thor
Posted 2:21 AM 16/12/07
Agreed. -f is a bad idea. Here is what I use for shortcuts:
Shutdown
shutdown.exe -s -t 0
this shuts down the computer just as if you clicked start, stop, shutdown.
Restart
shutdown.exe -r -t 0
this restarts the computer just as if you clicked start, stop, restart
I put these shortcuts on my Quicklaunch bar on the Taskbar and give them icons similar to their functions.
Thor
BigDASH
Posted 7:57 AM 16/12/07
I use this all the time when I using remote desktop and need to restart the machine I have remoted into.
BigDASH
mikekarr
Posted 7:46 AM 16/12/07
Many IT departments have your systems caches cleared on shutdown as well. This makes shutting down take longer, but also removed sensitive information that might be stored temporarily on your hard drive
mikekarr
yriafelc
Posted 1:07 AM 17/12/07
I didn't knew that the time can be less than 1.
I usually do:
shutdown -s -t 1 -f
easy to remember as saying STFU to your computer. LOL!
yriafelc
fedmich
Posted 7:44 AM 17/12/07
This is bad and could damage some files on you computers after sometime.
I own a computer shop here in Philippines, and maintains a lot of computers. At one time I had encountered a spyware that attaches that particular command on the "Upon login" of user. So this means even if you restarting your computer it will shutdown afterwars. Some of our computer just keeps on shutting down and restarting because of this command, and after a few turn-on and off of the computer, the scandisk just keeps on running on every start of that computer. We had to do some reformatting of the computer after a week. I hope you guys wont encounter this spyware, could mess up your files.
fedmich
ladieu
Posted 12:28 PM 17/12/07
tried this.... didn't close any of my programs. Basically I saw a command prompt flash and thats it. Workstation didn't even attempt to shut down.. weird.
ladieu
nintuks
Posted 9:52 PM 16/12/07
it doesn't work in vista ultimate :(
but this surely works in any machine and OS > "press the power button for 5 seconds" hehehe.
nintuks
unruled
Posted 12:24 AM 16/12/07
if you really want to use the 'shutdown -f -t 00' command with saving you time, what I have done in the past is create a shortcut in the taskbar, and instead of pointing to a program or directory, you just put the shutdown command there. You can even give it the shutdown icon!
The same can be done for a restart/reboot icon.
unruled
sirgregory
Posted 9:54 AM 15/12/07
I tried this but all it did was log me off to the welcome screen. My laptop remained on.
sirgregory