I found this cmd shutdown command useful for me as I managed several servers in a different location where physical access is not always possible. My favorite command is shutdown /f /r that will force close the application and restart the server.
Shutdown command is a small useful program that I use for several situations:
When normal shutdown does not work
If I run a program that becomes not responding and the end task command also does not work my last resort is to restart or shutdown the computer. However, this is not always working, when this happens I will use cmd shutdown command to accomplish the task.
When I need to shutdown a remote computer that physically away from my location.
Managing several servers in different location need some utility software so that we can manage efficiently, one of them is cmd shutdown command. I use shutdown cmd command to restart the server mostly I never use shutdown command to shutdown because it will need someone to help to turn on the server physically.
Shutdown command has a lot of parameter that very useful and can be applied in various situations.
Syntax: shutdown [/i | /l | /s | /sg | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/soft] [/fw] [/f]
[/m \computer][/t xxx][/d [p|u:]xx:yy [/c “comment”]]
/? Show this help. The same result by not adding any parameter.
/i Show GUI interface, must put as the first parameter.
/l Log off option. This cannot be combined with /m or /d parameters.
/s Shutdown the computer.
/sg Shutdown the computer on the next boot, restart any registered applications.
/r Full shutdown and restart the computer.
/g Full shutdown and restart the computer. After the system is
rebooted, restart any registered applications.
/a If you changed your mind this parameter is to abort a system shutdown.
As long as the shutdown not initiated yet.
Combined with /fw to clear any pending boots to firmware.
/p Turn off the local computer without time-out or warning.
It can be combined with /d and /f parameters.
/h Hibernate the local computer.
It can be combined with the /f option.
/hybrid Shutdown of the computer and prepares it for fast startup.
Must be combined with /s parameters.
/fw Combined 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 implied.
/c “comment” Comment on the reason for the restart or shutdown.
Maximum of 512 characters allowed.
/f Force running applications to close without user warning.
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.
p indicates that the restart or shutdown is planned.
u indicates that the reason is user-defined.
If neither p nor u is specified the restart or shutdown is unplanned.
xx is the major reason number (positive integer less than 256).
yy is the minor reason number (positive integer less than 65536).
This shutdown command also useful when we need to restart the computer but somehow the button doesn’t react as it should be. This sometimes happen after we installed Windows updates.
Some samples of using the shutdown command:
When we need to force the server to restart and close all the applications without warning we can issue the command:
shutdown /f /r
Need to shut down the computer
Need to restart the computer
Need to log off your computer
Need to abort the shutdown process before it starts initiating
Just type shutdown without parameter like above and try to combine other parameters to match your requirement.