Using CMD commands for Shutdown and Restart helps you address certain computer errors in emergencies or create shortcuts for faster operations.

1. Shutdown Command in CMD
The Shutdown command, also known as the power-off command in CMD, is used in essential situations. With the Shutdown command in CMD, you can choose to shut down immediately or schedule the shutdown time as per the set time in the command.
Command:
Shutdown -s -t 0 |
Where:
- Shutdown: Opening command
- -s: Shutdown command
- -t 0: Time the computer stays on before shutting down (in seconds “s”)
Example:
In this scenario, Mytour wants to shut down the computer using the Shutdown command in CMD with a specified time of 2 hours (7200 seconds), the command will be as follows:
Shutdown -s -t 7200 |

After successfully entering the command, the system will display a notification at the bottom corner of the main screen with the message: “Windows will shut down in 120 minutes” – The computer will shut down after 120 minutes.

Note: If you do not provide a value for the “-t” parameter in the command, the system will default to automatically shutting down the computer after 30 seconds. If you want to shut down the computer immediately, simply set the “-t” parameter value to 0.
2. Restart Command in CMD
Similar to shutting down the computer, you can also restart the computer using a quick command in Command Prompt. Here is the detailed process of restarting the computer in CMD.
Command:
Shutdown -r -t 0 |
Where:
- Shutdown: The command to initiate
- -s: Shutdown command
- -t 0: Time the computer stays on before shutting down (in seconds “s”)
Example:
In this scenario, Mytour wants to shut down the computer using the Shutdown command in CMD with a specified time of 2 hours (7200 seconds), the command will be as follows:
|

Similar to the shutdown command, after entering the command, you will receive a notification at the bottom corner of the computer screen. Once the command is complete, you just need to wait until the countdown timer expires for the computer to automatically restart.

3. How to Cancel Shutdown/Restart Command in CMD
In case you mistakenly set the shutdown or restart command in CMD, you can easily cancel them with a simple command below:
Command:
Shutdown -a |

After entering the command to cancel the shutdown or restart in CMD, you will receive a notification at the bottom right corner of the screen with the message: Log-off is cancelled – Shutdown command has been canceled!

4. Some other shutdown commands in CMD
4.1 Log-Off Command
The Log-Off command, also known as the command to quickly and efficiently log out of the current Windows account in use. The command for the log-off feature is as follows:
Command:
Shutdown -i -t 0 |

Where:
- Shutdown: The command to initiate
- -i: Command to log off the current session
- -t 0: Time the computer will shut down after entering the command (measured in seconds “s”)
4.2 Hibernate Command
Hibernate, also known as sleep mode, is a favorite mode for many Windows users. It allows the computer to resume work instantly without reopening previous applications.
Command:
Shutdown -h -t 0 |
Where:
- Shutdown: The command to initiate
- -h: Command to put the computer into hibernation mode
- -t 0: Time the computer will shut down after entering the command (measured in seconds “s”)

4.3 Command to Access BIOS in the Next Boot
If you want to access BIOS, you can use a quick command in CMD instead of pressing DEL or F2 during the computer boot process.
Command:
Shutdown –r -fw –t 0 |
Where:
- Shutdown: The command to initiate
- -r -fw: Command to put the computer into BIOS mode
- -t 0: Time the computer will shut down after entering the command (measured in seconds “s”)

4.4 Activate Fast Startup Command
Enabling Fast Startup feature in Windows assists in swiftly booting up your computer due to pre-configured BIOS settings. You can activate it using CMD instead of adjusting it in the BIOS with the following command:
Command:
Shutdown -s -t -3600 -hybrid |
Where:
- Shutdown: The command to initiate
- -s: Command to put the computer into shutdown mode
- -t 0: The time the computer will shut down after entering the command (measured in seconds “s”)
- -hybrid: Command to activate the Fast Startup feature

4.5 Emergency Shutdown Command in CMD
Unlike the previous commands, the emergency shutdown command in CMD will immediately turn off the computer without asking for any information.
Command:
shutdown –p |

4.6 Mandatory Shutdown/Restart Command
If your computer encounters issues and you find yourself unable to resolve them, the best course of action is to force them to shut down in order to manually restart:
Command:
shutdown -p -f |

4.7 Opening Remote Shutdown via CMD
In the event that you wish to open the Remote Shutdown dialog to turn off or restart your computer remotely, you can quickly do so in CMD with the following command:
Command:
shutdown –i |

4.8 Remote Computer Shutdown Command
In addition to the shutdown commands currently in use, CMD also empowers you to remotely shut down another person's computer, provided you have established the necessary connection and control requirements.
Command:
shutdown –m \”Tên máy tính hoặc tên IP” –s (-h, -r) –t 0 |

In this article, Mytour has shared with you the commands to shut down and restart your computer using CMD. Wishing you a joyful day!