Friday, November 1, 2013

Windows: Shutdown from command prompt

How to reboot or shut down Windows from within a script, or even a remote session:
:: show shutdown dialog:
 shutdown -i

:: halt:
 shutdown -s

:: reboot:
 shutdown -r

:: reboot, open all registered applications afterwards:
 shutdown -h

:: log off user:
 shutdown -l

:: shutdown in 60 seconds:
 shutdown -t 60

:: abort shutdown (if previously invoked with -t):
 shutdown -a

:: close all applications without warning:
 shutdown -f

:: enter boot options menu after reboot:
 shutdown -o

:: turn off computer, no warnings:
 shutdown -p

:: hibernate:
 shutdown -h

:: shutdown a specific computer:
 shutdown /m \\HOSTNAME

No comments:

Post a Comment