Using the Shutdown, Restart command with the CMD command helps you handle some computer errors in an emergency or create shortcuts for faster operations.
1. Shutdown command in CMD
The Shutdown command, also known as the shutdown command in CMD, is used in some essential cases. For the Shutdown command in CMD, you can choose to shut down immediately or turn off the timer depending on the amount of time set in the command.
Command:
In there:
- Shutdown: Command opening sentence
- -S: Shutdown command
- –t 0: Time the machine is turned off after entering the command (in seconds “s”)
For example:
In this case, Thuthuatphanmem wants to turn off the computer with the Shutdown command in CMD with a time interval of 2 hours (7200 seconds), the command will be as follows:
After entering the command successfully, the system will appear a message in the lower corner of the main screen of the computer with the content: “Windows will shut down in 120 minutes” – The computer will be shut down after 120 minutes.
Note: If you do not enter a value for the parameter “-t” In the command, the system will automatically shutdown after 30 seconds by default. If you want to shutdown immediately then you just need to give the parameter value “-t” is 0.
2. Restart command in CMD
Similar to shutdown, you can also restart your computer with a quick command in Command Prompt. Here is how to reboot the machine in detail in CMD.
Command:
In there:
- Shutdown: Command opening sentence
- -S: Shutdown command
- –t 0: Time the machine is turned off after entering the command (in seconds “s”)
For example:
In this case, Thuthuatphanmem wants to turn off the computer with the Shutdown command in CMD with a time interval of 2 hours (7200 seconds), the command will be as follows:
Similar to the shutdown command, after entering the command, you will also receive a notification in the lower corner of the computer screen. After the command completes, you just need to wait until the countdown time expires for the computer to automatically restart.
3. How to cancel the Shutdown/ Restart command in CMD
In case you misplaced the shutdown and restart commands in CMD, you can freely cancel them with a simple command below:
Command:
After entering the command to cancel shutdown, restart in CMD you will receive a message in the right corner of the screen with the following content: Log-off is canceled – The shutdown order has been cancelled!
4. Some other shutdown commands in CMD
4.1 Log-Off command
The Log-Off command, also known as the command to exit the current Windows account quickly and effectively. The command of the feature to exit the account using the computer is as follows:
Command:
In there:
- Shutdown: Command opening sentence
- -i: Command to exit current session
- –t 0: Time the machine is turned off after entering the command (in seconds “s”)
4.2 Hibernate command
Hibernate – also known as hibernation mode is also a favorite mode of many people when using Windows computers. They help the computer get to work immediately without having to reopen previous applications.
Command:
In there:
- Shutdown: Command opening sentence
- -H: Command to put the computer into hibernation
- –t 0: Time the machine is turned off after entering the command (in seconds “s”)
4.3 Command to access BIOS on next boot
In case you want to access the BIOS then you can use the quick command in CMD so that you don’t have to press DEL or F2 during computer startup.
Command:
In there:
- Shutdown: Command opening sentence
- -r -fw: Command to put the computer into BIOS open mode
- –t 0: Time the machine is turned off after entering the command (in seconds “s”)
4.4 Fast Startup Activation Command (Fast Startup)
Enabling the Fast Startup feature in Windows helps you to start your computer quickly thanks to some factory settings in the pre-installed BIOS. You can enable it in CMD instead of going into the BIOS by doing the following:
Command:
Shutdown -s -t -3600 -hybrid |
In there:
- Shutdown: Command opening sentence
- -S: Command to put the computer into shutdown mode
- –t 0: Time the machine is turned off after entering the command (in seconds “s”)
- -hybrid: Command to enable Fast Startup
4.5 Emergency shutdown command in CMD
Unlike the above commands, the emergency shutdown command in CMD will shut down the flooded machine immediately without asking you for any information.
Command:
4.6 Forced shutdown/reboot command
In case the computer crashes and you can’t handle them, the best way is to force them to shut down so that you can restart them manually:
Command:
4.7 Command to open Remote Shutdown with CMD
In case you want to open the Remote Shutdown dialog box to shutdown or start the computer remotely, you can also quickly open it in CMD with the following command:
Command:
4.8 Remote Desktop Eye Command
In addition to the shutdown commands in use, CMD also allows you to shutdown others remotely when you have fully established connection and control requirements.
Command:
shutdown –m \”Computer name or IP name” –s (-h, -r) –t 0 |
In this article, Thuthuatphanmem has shared with you the commands to shutdown and restart the computer in the CMD tool. Have a nice day!