I’ve been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart.
How do I control my computer’s power state through the command line?
The most common ways to use the shutdown
command are:
shutdown -s
— Shuts down.
shutdown -r
— Restarts.
shutdown -l
— Logs off.
-
shutdown -h
— Hibernates.
Note: There is a common pitfall wherein users think -h
means “help” (which it does for every other command-line program… except shutdown.exe
, where it means “hibernate”). They then run shutdown -h
and accidentally turn off their computers. Watch out for that.
-
shutdown -i
— “Interactive mode”. Instead of performing an action, it displays a GUI dialog.
shutdown -a
— Aborts a previous shutdown command.
The commands above can be combined with these additional options:
I want to make sure some other really good answers are also mentioned along with this one. Here they are in no particular order.
- The
-f
option from JosephStyons
- Using
rundll32
from VonC
- The Run box from Dean
- Remote shutdown from Kip