Karl's Windows Admin Tips & Tricks

Aug 24 2010   10:49AM GMT

Canceling a Windows Shutdown From The Command Line.

Karl Gechlik Karl Gechlik Profile: Karl Gechlik

Tags:
Windows

As someone that habitually tweaks his Windows desktop I can assure you I use this little dos command to stop by system shutdowns daily. When you kill a service that another system service was dependent upon your system can issue a reboot. Sometimes Windows wants to restart after updates and it can be really easy to accidentally click on OK.

When either of these issues happen we normally see a box with a count down. When that count down reaches 0 your system will reboot. If you are quick enough you can open an elevated command prompt and issue the command Shutdown /a to cancel it.

But if you think ahead you can create a shortcut to a batch file on your desktop. Make sure the shortcut is set to run as the administrator or another user with administrator privileges.  As soon as you enter this command or run the batch file with the command in it your workstation or server will stop shutting down.

If you are curious you can also use this command to shutdown or reboot a system in a pinch. I remove the shutdown and restart menu options from most of my terminal servers and production servers. When I need to reboot them I drop to a command prompt and issue:

Shutdown -r -t 00

This will reboot the system without any wait. It will start killing processes immediately so use this with caution. You can also use the switch -s to shut down and you can change the 00 to anything from 01 to 99. Using 01 will wait 1 second before shutting down and 99 will wait 99 seconds before shutting down.

This is really good information to know. Store it in the back of your head. And if your production server wants to reboot during the day you will know how to stop it!

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: