Windows can be restarted or rebooted by using the command line without the need for any GUI and related tool. The shutdown and Restart-Computer commands can be used to restart windows systems via MS-DOS or PowerShell command line.
Restart/Reboot Windows with shutdown Command
The shutdown command is a command-line tool that can be used in MS-DOS or PowerShell. First, open the MS-DOS command prompt via the start menu by typing cmd.exe which will list the MS-DOS command prompt.
The shutdown command is created to shutdown or restart the windows system. In order to restart the current system use the /r option. By default when the shutdown command is executed there is 1 minute delay which means the system will restart after 1 minute.
Restart/Reboot Windows Immediately with shutdown Command
By default the shutdown /r command restart the computer after 1 minute delay. Even this is a best practice to provide some time to save tasks and documents it can be also a problem in some cases. The windows system can be restarted immediately with the “shutdown /r” command by providing the /t 0 as parameter.
shutdown /r /t 0
Restart/Reboot Windows After Specified Time Delay with shutdown Command
The shutdown command provides the ability to reboot the windows after a specified time which is expressed as seconds. The /t option is used to specify delay time in seconds. In the following reboot example, we will restart the system after 120 seconds.
shutdown /r /t 120
Restart/Reboot Windows with Restart-Computer PowerShell Command
PowerShell provides the Restart-Computer command or cmdlet in order to restart Windows computers. Just running the Restart-Computer reboots the system.
Restart/Reboot Remote Windows with Restart-Computer PowerShell Command
The Restart-Computer command provides the ability to restart specified remote computers. The -ComputerName is used to specify remote computers by hostname or IP address.
Restart-Computer -ComputerName mypc
Also multlplie remote systems can be rebooted with the Restart-Computer command like below. The remote computers hostnames or IP addresses are separated with the comma.
Restart-Computer -ComputerName mypc,192.168.10.20