Shutdown and restart commands in cmd

I want one desktop shortcut that restarts the PC straight away and another that shuts it down after an hour. I know it's the shutdown command but can't remember the switches. Which ones do what?
1

Leave A Reply

Log in to post an answer.

1 Answer

alex_gadget Oct 20, 2026
frank_gadget
shutdown /s /t 0 = shut down now shutdown /r /t 0 = restart now shutdown /a = cancel a pending one (only works while the countdown is still running) Change the 0 to a number of seconds if you want a delay, e.g. /t 600 for ten minutes. Add /f to force apps closed without asking, handy if something keeps blocking it but you lose anything unsaved. shutdown /l logs you off and shutdown /h hibernates, if hibernate is enabled.