Here are some useful switches (flags) that can be combined to shut down or restart a computer. For more information on Windows command prompt and PowerShell, see the link.
-r This will have the server shutdown and then restart -f This will force the server to close any running application -t 01 This is a time-out before shutdown.
Combining these commands into a single syntax, we have the following command below
shutdown -r -f -t 00
When this command is run from the command prompt as shown below, the device will be restarted immediately because of the time specified.
As you can see, the device restart is being initiated as shown below.
Here's how to do the shutdown functions via a the CLI (batch file): shutdown -r — restarts shutdown -s — shutsdown shutdown -l — logoff shutdown -t xx — where xx is number of seconds to wait till shutdown/restart/logoff shutdown -i — gives you a dialog box to fill in what function you want to use shutdown -a — aborts the previous shutdown command....very handy! shutdown -h — hibernate. Easy mistake - it's not for help Additional options: -f — force the selected action
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.