Windows Shutdown Command to Power off Laptop with Keyboard

There are times when you need to shut down your laptop with keyboard. It is more than cool, but actually really useful when the Power button and your mouse are not working, or when you need to restart your computer in schedule. In this article, we are going to introduce the full list of Windows shutdown command and how to create a batch file so that anyone will be able to perform the shutdown command with a double-click.

Windows Shutdown Command

Part 1. How to Shutdown Windows 10 with Command Prompt

Windows shutdown shortcuts is a series of commands that should be executed in Command Prompt. Let’s get started with CMD now!

Windows Shutdown Command Syntax

shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/f] [/m \\computername] [/t xxx] [/d [p:|u:]xx:yy] [/c “comment”] [/?]

Pro tips: Make sure to save and close your works before shutting down or restarting your PC. Otherwise, you may need to recover lost files from Windows 10 with iReparo Data Recovery Software.

Download iReparo for PC Windows Download iReparo for PC Mac

Part 2. Most Used Windows Shutdown Commands

Here we are going to introduce several common shutdown shortcuts with examples. You may refer to the full list on Part 4.

Unlike the plain text listed in command prompt, Windows shutdown commands can be diversified and very useful in actual application.

Option 1. Log off Current User from Computer

shutdown /l
This shutdown command will log off the user from current computer immediately without any warning message.

Option 2. Shutdown Local Computer with Delay

shutdown /s /t 30
This shutdown command will shut down the local computer in 30 seconds. You can replace /s with /m (plus the name of the remote computer) to define a remote computer, or change the number after /t to decide when to power off the computer, such as 0 (immediately) and 60 (one minutes later).

Option 3. Cancel a Shutdown Command

shutdown /a
This command will cancel a timed shutdown or restart which you have scheduled before it can complete.

Option 4. Shut down or Hibernate Computer

shutdown /s
shutdown /h

These are two common operations on our daily use with similar shutdown shortcut, so we introduce them together.

Part 3. Create Windows Shutdown Shortcut with Batch File

We are not going to actually create a new command to shut down Windows computer, but to package the existing command so that anyone will be able to apply it with a double-click on the desktop.

Batch file is a common form of packaged commands.

Here we show you how to create a batch file which includes a command to shut down the computer in one minute.

You can see more about the application of batch file here.

Part 4. Windows Shutdown Commands

Here is the full list of Windows shutdown commands with clear description.

Command Description
/i This command will open the Remote Shutdown Dialog where you can plan a remote shutdown or restart on a graphical user interface. The /i must be the first attribute shown and all other attributes will be ignored.
/l This attribute will log off the current user from the current PC. The log off command is not available for remote computer or other schedule attributes.
/s Shut down the local computer or replace it with /m to define a remote computer.
/r Shut down and then restart the local computer, or the remote computer with /m attribute.
/g Similar to the /r attribute but will restart any registered applications after the reboot.
/a Stop a scheduled shutdown or restart. Add the /m attribute for a pending shutdown or restart for a remote computer.
/p Turn off the local computer with warning. It is similar to shutdown /s /f /t 0.
/h Similar to click Sleep button on the start menu. You cannot apply it to put a remote computer into hibernation, nor can you use this attribute with /t, /d, or /c.
/e This attribute enables documentation for an unexpected shut down in the Shutdown Event Tracker.
/o Open the Advanced Boot Attributes menu to restart the PC. This attribute must be used with /r.
/hybrid Perform a shutdown and prepares the computer for fast startup.
/f Force close running applications without warning.
/m \\computername Specify the remote computer where you want to perform a shutdown or restart.
/t xxx Set a time, in seconds, between the execution of the shutdown command and the actual shutdown or restart. The time can be anywhere from 0 (immediately) to 315360000 (10 years). If it is not specified, then 30 seconds is assumed.
/d [p:|u:]xx:yy Record a reason for the restart or shutdown. The p attribute indicates that it is a planned restart or shutdown and the u a user defined one. The xx and yy attributes specify major and minor reasons for the shutdown or restart.
/c “comment” This attribute allows you to take a note to describe the reason for the shutdown or restart. You must include quotes around the comment with the maximum length up to 512 characters.
/? Show detailed help about the command’s several attributes, same as the command “shutdown” without any additional attributes.

Bottom Line

In this tutorial, we have learnt how to power off Windows 10 laptop or desktop with shutdown commands. You can even create a shortcut as batch file to execute the command with a click. There are a lot of benefits as long as you apply the commands properly. Feel free to share your opinions or any questions with us in the comment.

/ Public by Jihosoft

Follow Jihosoft