Software Development

Shutdown and Abort Shutdown in Windows using DOS

This post shows how to use a DOS command to shut down or abort shutdown in Windows. We sometimes need to leave our machines up and running for some colleagues to use them (e.g., to test a web application). But leaving them running for the whole night might be a bad idea. Some companies have policies on power usage, particularly for non-production servers, and may require you to shut down your machine when you leave for home.

Having a script to shut down your machine regularly could help you save on monthly electric bills if you are working remotely. Moreover,  your personal computer may serve you the longest by ensuring that it is not running unnecessarily.

DOS Command to Shut down Windows After Some Time

Using the following DOS command in Windows, you can shut down your computer after n number of seconds. In this case, the command shuts down the machine in 3 hours from when we ran the command.

DOS Command to Abort Shutdown

If you change your mind, you can always abort the impending shutdown. To do so, run the following DOS command.

The DOS shutdown command does not only shut down or abort a shutdown on Windows. It can also restart your Windows machine using the /r option with the shutdown command. However, some advance options may need some administrator rights to work. If you cannot run the simple commands we used on this post on a corporate machine, your employer may have given you a more restricted account. In that case, please check with your local IT.

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like