How To Shutdown Windows via Command-line Interface (CMD)?

Windows computers can be shut down via the command-line interface. This command-line interface can be the old friend MS-DOS (cmd.exe) or PowerShell. The shutdown command can be used to shut down local and remote computers.

Shutdown Windows

Windows provides the shutdown command in order to shutdown the computer via the command-line interface. The /s parameter is provided in the shutdown command.

shutdown /s

Once the command is executed we will see the following message which is “You’re about to be signed out. Windows will shut down in less than a minute“. As stated in the message the system will shut down in less than a minute not immediately.

Shutdown Windows

We will see the following screen which is shutting down.

Shutdown

Shutdown Windows Immediately

The “shutdown /s” command do not shut down windows immediately where it provides 1 minute delay before the shutdown. Even this can be useful some cases it is not ideal for every case. The system can be shutdown immediately by providing the time parameter which is /t as 0 like below. This will shut down windows immediately.

shutdown /t 0 /s

Cancel/Stop Shutdown Operation

The shutdown command takes 1 minute by default. Also, more delay can be specified for the shutdown. But if we want to stop or cancel the shutdown command the /c option can be specified.

shutdown /c

Shutdown Remote Computer

The remote windows can be also shutdown by using the shutdown command with the /m parameter and the remote computer hostname or IP address.

shutdown /s /m 192.168.10.10

Shutdown with PowerShell Stop-Computer Command

PowerShell provides alternative to the shutdown MS-DOS command which is Stop-Computer.

Stop-Computer

The Stop-Computer can be also used to stop remote computer. The -ComputerName parameter is used to specify the remote computer to shutdown.

Stop-Computer -ComputerName 192.168.10.10,DNS1,DC1
See also  How To Change Directory In Command-Line or cmd?

Leave a Comment