Shutdown via cmd – this is how it works

How to shut down your PC via the windows user interface, every windows user knows. However, the user interface only provides its users with limited options at disposal. Less well known is that computers can be shut down in a variety of ways by entering special shutdown commands in the command prompt, which is an operating system shell that allows interaction between the user and windows.

Buy domains cheap

Domains as unique as your ideas. What are you waiting for?

Register now your desired domain with IONOS!

e-mail box
wildcard SSL
personal advisor

Windows shutdown via command: explanation and advantages

The windows command prompt is a powerful tool from the old MS-DOS days that still accepts countless commands for special purposes today. Behind the designation is ultimately an executable program: the cmd.Exe, which offers after its call a command line for the command input (the actual input prompt). For shutdown, this command line tool addresses another program: the "shutdown.Exe"for example, shuts down the PC directly after calling it, restarts it or logs off the current user.

the advantages of command-based control are obvious: windows shutdown commands save you mouse clicks and you don’t have to surf through menus. The detours via the windows user interface omitted. if you trigger a shutdown-command, the computer can be shut down directly and quickly.

Other advantages are flexibility and adaptability: you can choose from different shutdown variants and thus proceed quite variable. A fine tuning of the desired mode is done with addition of additional control parameters. Each mode is intended for a specific use case. Because of their customizability, shutdown routines play an important role in administrative areas, for example. This allows remote control of remote pcs and servers via manual command entry. Special shutdown scripts are also used to automate routines, some of which are relatively easy to create.

We show where to enter CMD commands and what special syntax to follow. We also present various shutdown options dar.

the first step: invoking the input prompt for shutdown commands

If you want to use the cmd.Exe to enter windows shutdown commands, you can use two methods depending on your preferences for computer operation:

  • Calling by mouse click and entering "cmd
  • call via keyboard combination and "cmd" input

Calling the input prompt by mouse click and search for "cmd"

1. search field in the windows taskbar at the lower left edge of the screen:

call of the windows command prompt (cmd.Exe) via windows search

2. Letter sequence "cmd"enter the following in the search field:

Selection menu for calling the windows prompt and for other options.

3. press enter or click with the mouse on "open"click.

As you can see on the screenshot, there are different options. You can execute the command prompt with restricted right launch or "run as administrator". In the latter case the cmd operates.Exe with extended access rights. Prerequisite: the use of administrator rights must be explicitly permitted in the active user account to which a user logs in when starting windows.

For a shutdown command the normal mode is usually sufficient. The administrator mode recommended if desired commands cannot be executed in normal mode. But you should always keep in mind: by using administrator privileges programs get wide powers. If they are infected with viruses, for example, damage can be done to the system.

Call via keyboard combination and enter "cmd

If you prefer to operate your operating system using a combination of keys, you can also activate the input prompt using this method:

1. The [windows] key + [R] press simultaneously (the windows key is marked on the keyboard with the windows "flag" symbol).

2. character string "cmd" type search in the input field that opens, press enter or click on "OK"click:

Use the execute dialog to call the windows command prompt after entering "cmd" and confirming with "OK" or "OK". By input key on.

Shutdown via CMD input: this is how the command line commands work

Both call methods cause windows to open the input prompt in a separate window, where you can now define the desired shutdown command:

[USERNAME] is in this case a placeholder for the name of the active administrator or. user account

The windows command line can be numerous shutdown codes process. For this, the exact names and control parameters have to be entered in compliance with the appropriate (command) syntax can be entered. The standard syntax in this case is as follows:

Shutdown commands consist of the basic command "shutdown" and additional control parameters. The latter decide, for example, whether a system should be shut down (/s) or restarted (/r). It is always possible to combine several parameters.

The most important commands for shutdown via CMD

In the following you will get a tabular overview of the most important windows shutdown commands, which can be executed using the input prompt.

The input prompt supports under windows 10 copy-and-paste. you can copy the commands from this article (key combination: [ctrl] + [C]) and then paste them (key combination: [ctrl] + [V]) into the input window. Since running programs can be closed without asking and data can be lost, you should close important programs and save data beforehand.

PC shuts down immediately

restart the computer

Current user is logged off

Forced shutdown: forced shutdown of running application (user receives no warning)

The mentioned commands work directly, so without further elaboration. More sophisticated shutdown procedures require more extensive syntax. Some examples:

Shutdown /s /t 20

local PC shuts down in 20 seconds (time specification at "/t-parameter" is freely selectable)

shutdown /r /m \\computername

Restart a remote pc (if necessary. If preparation is required: assigning access rights for remote control, changing firewall settings)

Shutdown /r /m \\computername /c "comment"

Restart a remote pc (the text behind the "/c-parameter" appears in a blue textbox on the screen of the addressed target pc)

example: reboot local pc after 20 seconds

The local PC will be shut down from the active user account in 20 seconds. The user account is named "peter":

Example of a simple shutdown command that causes a time-delayed shutdown.

example: forced restart of a remote pc after one minute

A remote computer [MY REMOTE-PC] shall after 60 seconds shutdown remotely. In the countdown-phase of the shutdown a textbox with the comment "please finish your work" will be faded in. The following syntax implements the task:

When formulating the syntax, the selected placeholder [MY REMOTE-PC] must be replaced completely (including square brackets) by your own specifications. In the comment the quotation marks must be on top (in front and behind).

Example of a more complex shutdown syntax. A remote controlled PC is shut down with a time delay.

If the command is executed successfully, this standard windows display appears on the screen of the remotely controlled REMOTE pc, supplemented by the desired comment: "please finish your work:

Blue textbox on remote PC after remote shutdown via command line.

Ambitious users of windows shutdown commands can define quite complex procedures for very specific application purposes. The windows prompt lists the basic syntax for doing this, when you click "shutdown /?"(without quotes) in the command line.

More shutdown options

You don’t have to use the command prompt to shut down windows in a variable way. Shutdown routines can also be started via a script (batch file) trigger that executes desired commands immediately without CMD invocation. Such files can be easily created with the windows text editor notepad, as a *.Bat-file save and start by mouse click:

example filename: shutdown_pc.Bat

When creating and testing batch files, there are a few things to keep in mind. In this video the necessary preparations is described in detail:

With the further click you load the video from youtube. in this case youtube may set cookies, which we have no control over.

Another option to trigger a shutdown in the shortest possible way is to create a windows shortcut. After right-clicking on the windows desktop, a menu opens, then select "new" and then "shortcut":

create shutdown shortcut: display after right mouse click on windows desktop.

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

  • "shutdown /s /t 20enter " (without quotation marks)
  • On "further"click
  • Assign a meaningful name
  • finish the process with "finish" exit

A click on the link will shutdown the PC with a delay of 20 seconds.

Leave a Reply

Your email address will not be published. Required fields are marked *