Command Prompt Shutdown -Allows you to shut down or restart a local or remote computer.
Used without parameters, shutdown will logoff the current user.
I find the timed shutdown command particularly useful. If I want to go to bed, but I know the computer will still need to churn away for another hour or two – I can set the computer to shutdown in 3 hours time (to give it a little leeway) – and push off for the night.
The shutdown command works with Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP.
|[No args]||Display help.|
|/i||Display the graphical user interface (GUI).|
|/s||Shutdown the computer.|
|/r||Full shutdown and restart the computer.|
|/g||Full shutdown and restart the computer. After the system is
rebooted, restart any registered applications.
|/a||Abort a system shutdown.|
|/p||Turn off the local computer with no time-out or warning.|
|/h||Hibernate the local computer.|
|/hybrid||Performs a shutdown of the computer and prepares it for fast startup.|
|/fw||Combine with a shutdown option to cause the next boot to go to the
firmware user interface.
|/e||Document the reason for an unexpected shutdown of a computer.|
|/o||Go to the advanced boot options menu and restart the computer.
Must be used with /r option.
|/m \\computer||Specify the target computer.|
|/t xxx||Set the time-out period before shutdown to xxx seconds.
The valid range is 0-315360000 (10 years), with a default of 30.
If the timeout period is greater than 0, the /f parameter is
|/c “comment”||Comment on the reason for the restart or shutdown.
Maximum of 512 characters allowed.
|/f||Force running applications to close without forewarning users.
The /f parameter is implied when a value greater than 0 is
specified for the /t parameter.
|/d [p|u:]xx:yy||Provide the reason for the restart or shutdown|
So, for example;
To shutdown the computer and force any open programs to close;
shutdown /s /f
To shutdown and restart autoloading the advanced boot menu;
shutdown /r /o
Top open the remote shutdown GUI;
I use two commands regularly:
shutdown /s /f /t 1800 – Shutdown after half an hour
shutdown /s /f /t 3600 – Shutdown after an hour
shutdown /s /f /t 7200 – Shutdown after Two Hours
shutdown /s /f /t 10800 – Shutdown after Three Hours
& abort [timer] shutdown (once I realise I’ve set the wrong time)…
shutdown /a – Abort the shutdown.
It can be a pain working out (Googling) the number of seconds in X hours; these batch files provide a time saving shortcut;