How one shuts down their PC via the Windows user interface is known by every Windows user. The user interface, however, only provides users with limited options. Less known is the fact that computers can be shut down in highly variable and very different ways by entering specific shutdown commands in the prompt. As an operating system shell, this enables an in­ter­ac­tion between the user and Windows.

Cheap domain names – buy yours now
  • Free website pro­tec­tion with SSL Wildcard included
  • Free private re­gis­tra­tion for greater privacy
  • Free Domain Connect for easy DNS setup

Windows shutdown via command: ex­plan­a­tion and ad­vant­ages

The Windows command prompt is a powerful tool from the old days of MS-DOS which today still accepts countless commands for special purposes. Behind the des­ig­na­tion there is ul­ti­mately an ex­ecut­able program: the cmd.exe, which provides a line for the command input (the actual prompt). For shutting down your computer, another program addresses the command line tool: the “shutdown.exe”, for example, shuts off the computer im­me­di­ately after the program is called up, restarts it or logs off the current user.

The ad­vant­ages of command-based control are obvious: through Windows shutdown commands, you save yourself mouse clicks and don’t have to surf through menus. Detours across the Windows user interface are avoided. Should one issue a shutdown command, the computer can be shut down directly and quickly.

Other ad­vant­ages include flex­ib­il­ity and ad­apt­ab­il­ity. One can select from various shutdown options and as a result proceed in a number of various ways. A fine ad­just­ment of the desired mode occurs through the addition of further control para­met­ers. Each mode is intended for a specific use case. Due to their ad­apt­ab­il­ity, shutdown routines play an important role in the ad­min­is­trat­ive field. This means that geo­graph­ic­ally-remote PC and servers are remotely time-con­trolled via manual command entries. Also, special shutdown scripts are used for the auto­ma­tion of routines that are at times re­l­at­ively easy to prepare.

Below, we will show you where one enters CMD commands and the specific syntax that one must observe. Fur­ther­more, we will provide info on several shutdown options.

The first step: call up the command prompt for shutdown commands

If one would like to use cmd.exe for entering Windows shutdown commands, two methods are available depending on your pref­er­ences for operating the computer:

  • Call-up via mouse click and entry of “cmd”
  • Call-up via keyboard com­bin­a­tion and entry of “cmd”

Call-up of the command prompt via mouse click and search for “cmd“

  1. Click on the search field in the Windows task bar at the lower-left screen margin:
  1. Enter the “cmd” letter sequence into the search entry field:
  1. Press the enter key or click on “Open” with the mouse.

As you can see in the screen­shot, there are various options. You can launch the prompt with re­stric­ted priv­ileges or “Run as Ad­min­is­trat­or”. In the latter case, the cmd.exe operates with extended access rights. However, one re­quire­ment is that ad­min­is­trat­or rights in the active user account must be expressly permitted.

Note

For a shutdown command, the default mode is normally suf­fi­cient. The ad­min­is­trat­or mode is re­com­men­ded if desired commands cannot be run in the normal mode. In doing so, however, one should always bear in mind that through the use of ad­min­is­trat­or rights, programs receive extensive au­thor­iz­a­tions. Should these become infected with viruses, for example, damage to the system can occur.

Call-up via keyboard com­bin­a­tion and entry of “cmd”

Anyone who prefers to use key com­bin­a­tions with their operating system can also activate the prompt with this method:

  1. Pressing the [Windows] + [R] keys at the same time (the Windows key can be found on most keyboards and is indicated by the Windows “flag” symbol).
  2. Entering the “cmd” letter sequence in the opening search entry field, then pressing the enter key or clicking on “OK”:

Shutdown via CMD entry: this is how the command lines work

Both call-up methods cause Windows to open the command prompt in a separate window through which you can now define the desired shutdown command:

The Windows command line can process numerous shutdown codes. To this end, the exact des­ig­na­tions and control para­met­ers must be entered in ac­cord­ance with the ap­pro­pri­ate (command) syntax. The standard syntax is the following:

shutdown /Parameter

Shutdown commands, thus, combine the basic “shutdown” command and ad­di­tion­al control para­met­ers. The latter decide whether a system should be, for example, shut down (/s) or restarted (/r). In doing so, the com­bin­a­tion of several para­met­ers is always possible.

The most important commands for shutdowns via CMD

Below you obtain a tabular overview of the most important Windows shutdown command that can be run using the command prompt.

Tip

The command prompt in Windows 10 supports copy and paste. You can copy the commands from this article (key com­bin­a­tion: [Ctrl] + [C]) and then place them in the entry window via paste (key com­bin­a­tion: [Ctrl] + [V]). Because the running program could be closed without your re­quest­ing it – resulting in the loss of your data – you should first close any important programs and back up your data.

shutdown /s Shut down PC im­me­di­ately
shutdown /a Abort shutdown
shutdown /r Restart computer
shutdown /l Log off current user
shutdown /f Force shutdown: forces the running ap­plic­a­tion to close (the user receives no advance warning)

These commands function im­me­di­ately. In other words, without any further for­mu­la­tion. Soph­ist­ic­ated shutdown pro­ced­ures require a more com­pre­hens­ive syntax. Some examples:

shutdown /s /t 20 Shuts down local PC in 20 seconds (time spe­cific­a­tion with “/t-Parameter” is freely se­lect­able)
shutdown /r /m \\Com­puter­name Restarts a remote PC (pre­par­a­tion may be required: as­sign­ment of access rights for remote control, change of Firewall settings)
shutdown /r /m \\Com­puter­name /c “comment” Restarts a remotely-operated PC (the text behind the “/c-Parameter” appears in a blue text box on the screen of the addressed target PC)

Example: Restart the local PC after 20 seconds

The local PC is shut down by an active user account in 20 seconds. The user account has the des­ig­na­tion “Peter”:

Example: the forced restart of a remote PC after one minute

A remote computer [MY REMOTE PC] is supposed to be shutdown remotely after 60 seconds. In the countdown phase of the shutdown, a text box with the comment “Please finish your work” is supposed to be shown. The following syntax im­ple­ments the task:

shutdown /s /m \\[MY REMOTE PC] /t 60 /c "Please finish your work"

When for­mu­lat­ing the syntax, the selected place­hold­er [MY REMOTE PC] should be com­pletely (including square brackets) using one’s own data. With the comment, the quotation marks shown above must be placed at the front and back.

If the command is suc­cess­fully run, this standard Windows display appears on the screen of the remotely-operated PC, ac­com­pan­ied by the desired comment: “Please finish your work”:

Ambitious users of Windows shutdown commands can define highly complex pro­ced­ures for very specific purposes. The Windows command prompt lists the fun­da­ment­al syntax building blocks for this if one enters “shutdown/?” (without quotation marks) in the command line.

Ad­di­tion­al shutdown options

It is not mandatory that you rely on the command prompt in order to shut down Windows in different ways. Shutdown routines can also be initiated via a script (batch file) which im­me­di­ately runs the desired commands without a CMD call-up. One can easily create these types of files with the Windows Text Editor notepad, save them as a *.bat file and launch them via mouse click.

Example file name: Shut off_PC.bat

@echo off
shutdown /s /t 20

When creating and testing batch files, there are a few things to keep in mind. In this video the necessary pre­par­a­tions are thor­oughly demon­strated:

DOHGUAaDFfU.jpg To display this video, third-party cookies are required. You can access and change your cookie settings here.

Another option for ini­ti­at­ing a shutdown in the shortest way possible is the Windows shortcut. After right-clicking on the Windows Desktop, a menu opens, then click “New” followed by “Shortcut”.

The opening entry window can also handle code. A shutdown shortcut on the desktop is quickly produced:

  • enter “shutdown /s /t 20” (without quotation marks)
  • click on “Next
  • assign a mean­ing­ful name
  • end the process with “Finish

A click on the shortcut then shuts down the PC with a 20-second delay.

Go to Main Menu