If you need to restart or shutdown a Windows PC or server using the command line. Go to the command prompt:
Start > Run > cmd
Run either of the the following commands.
shutdown /r /t 00
shutdown /s /t 00
Windows will instantly begin shutdown or restart the server.