Shutdown command: Shut down and restart Windows from the command line


Reboot with different keys

To perform this procedure, you need Administrator rights.

First of all, you need to launch Command Prompt. You can read about how to do this on our website.

The “Shutdown” command is responsible for restarting and shutting down the PC. Below we will look at several options for restarting your computer using different keys.

Method 1: Simple Reboot

For a simple reboot, enter in cmd:

A warning message will appear on the screen and the system will restart after 30 seconds.

Method 2: Delayed reboot

If you want to restart the computer not immediately, but after a while, in “Cmd” enter:

shutdown -r -t 900

where 900 is the time in seconds before the computer restarts.

A message indicating a scheduled shutdown will appear in the system tray (lower right corner).

You can add your comment so you don't forget the purpose of the restart.

To do this, add the “-c” switch and write a comment in quotes. In Cmd it will look like this:

And in the system tray you will see the following message:

Method 3: Reboot the remote computer

You can also reboot the remote computer. To do this, you need to add its name or IP address separated by a space after the “-m” key:

shutdown -r -t 900 -m \Asmus

shutdown -r -t 900 -m \192.168.1.101

Sometimes, if you have Administrator rights, you may see the “Access denied (5)” error.

    To fix it, you need to remove the computer from the Home Network and edit the registry.

In the registry, go to the folder

Right-click on the free space, in the context menu go to the “New” and “DWORD Value (32-bit)” tabs.

Name the new parameter “LocalAccountTokenFilterPolicy” and give it the value “00000001”.

Examples of using the shutdown utility

If you run the shutdown

with the
/i
, you will see something like the following on the screen (relevant for Windows 7):

When using delayed reboot:

Shutdown /r /t 180

We will receive the following notification on the screen:

If you want to cancel the scheduled reboot, use the command:

You should see something like this in the notification area next to the clock:

Reboot via TeamViewer

If you need a comprehensive tool for managing your computer, then TeamViewer is perfect for this role. Download and install it according to our instructions:

  1. Open the link and click on the “Download for free” button.

  1. On the first screen, click “Accept-Complete”.

  1. After installation, the program will launch automatically. TeamViewer must also be installed on the second computer. On the PC to which you are connecting, you need to look at the ID (1) and enter it in the “Partner ID” field on the control computer (2). After that, click “Connect to partner” (3).

Now you will have access to the desktop of the second device. You will be able to reboot it through the Start menu or Alt + F4.

After rebooting, TeamViewer will require you to log in again, which may not be possible. Therefore, initially you need to enable easy access in the options:

  1. In the TeamViewer window, click on "Advanced" and select "Options".

  1. Open the Security tab. Enter your password twice in the marked fields (1) and check the box next to “Give easy access” (2). After this, click on “Configuration” (3).

  1. In the window that opens, enter the login and password of the account to which you plan to connect without authorization.

Ready! Now, after each reboot, you don’t have to run to a remote computer and enter your account password manually or ask a user located next to the connected PC to do this.

Allow remote reboot in firewall

Step 1. On the remote PC, press the Win+R keys, type “firewall.cpl” and click “OK”.


On the remote PC, press the Win+R keys, type “firewall.cpl” and click “OK”

Step 2. In the window that opens, click on the “Allow the app...” link.


In the window that opens, click on the link “Allow the app...”

Step 3: Click Change Settings at the top right of the window.


Click “Change Settings”

Step 4. Find the line “Windows Management...” at the bottom of the list and select it with a checkmark on the left. If the local and remote PCs are on a public network, also check the “Public” box on this line on the right. Click "OK".


Select the line “Windows Management...” with a checkmark on the left, put a tick in “Public” and click “OK”

The firewall will now allow remote PC reboots.

Using the keyboard

Some remote administration programs disable the ability to shut down or restart the computer. For example, in an RDP application, you won't be able to perform these steps because they simply aren't available in the Start menu. The developers did this for convenience in large networks with multiple users. As a result of this restriction, no one will accidentally turn off the computer while another user is working on files. In this case, the keyboard and Windows hotkeys come to our aid:

  1. The first step is to minimize or close all open windows on the remote device.
  2. Then press the combination Alt + F4 on your keyboard to open a window with a choice of actions. The appearance is slightly different in Windows 7, 8 and 10, but the functionality is the same.

  1. Select "Reboot" from the drop-down menu and click "OK." After this, you just have to wait until the PC turns on again.

This option is not always appropriate, so it is best to know how to reboot via the command line.

Reboot the PC via the command line

Before you can launch Powershell and enter the appropriate commands, you must enable the Remote Registry service on both devices. In Windows 10 you can do this as follows:

  1. First, open the Run window using the Win + R combination and enter the command “services.msc”.

  1. In the list of services, find the line “Remote Registry” and double-click on it.

  1. In the Startup Type field, set the option to Automatic.

  1. Click the “Apply” button and then “Run”.

  1. After that, close the Settings and Services window.

To use PC/laptop reboot via the command line, you need to know its name. To do this, do the following:

  1. On the remote PC, you need to open “Explorer” and click on “This PC”.

  1. In the top bar, click Computer and then Properties.

  1. Pay attention to the “Computer name” field. Remember or copy the device name. It will be useful for the command in cmd.

Now we return to the administrator's PC. Knowing the name of the second device, you can reboot it, even if it is frozen and does not respond to your actions. Let's move on to rebooting a working or frozen computer:

  1. Launch command prompt. To do this, enter the appropriate query in the search. After that, right-click on the program and select “Run as administrator.”

  1. Reboot parameters and conditions can be specified using written commands. To avoid remembering them, it is better to use a graphical interface. It can be accessed using the “shutdown /i” command.

  1. The “Remote Shutdown Dialog” will appear on the screen. You need to add a second PC to the list and connect to it. To do this, click on the “Add” button.

  1. Enter the name of the device you found in the previous manual.
  1. Select your PC and specify the desired action. You can also enter a reason and note here. To start the procedure, click “OK”.

You can reboot a PC remotely only if it was previously connected to a network or a remote administration program. If the device freezes before setting up the connection, then all the steps described will not help. Make sure in advance that you have several access methods: via the network and via the Internet using a special program. The equipment can freeze at any moment, and you will be prepared for such a situation.

Putting your computer into hibernation mode

You already know how to restart your computer via the command line, but you can not only restart your computer, but also “send” it to hibernation mode. First you just need to make sure that the function is enabled in the settings of Windows itself. To do this you need:

  1. Go to the “Control Panel” by holding down two keys Win + r and enter the command “control”

  2. In the "Control Panel" select "Power Options".

  3. Click on the line “Actions of the power buttons”.

  4. Next “Change settings”

  5. Put o.

And you also need to make sure that there is enough space on drive C (where the system is installed) to save the hibernation file. It takes up as much RAM as is installed in the PC. That is, if the computer has 16 gigabytes of RAM, then to enable hibernation mode there must be at least 16 gigabytes of free space on the system disk.

Otherwise, the function will be automatically disabled.

And to put the computer into hibernation mode from the command line, use the command: shutdown /h

Can you tell a cringe from a crash? Take this fun test and find out!

First steps to turn off or restart your computer over the network

To perform this process correctly, you must be connected to the same local area network (LAN) as the computer you want to shut down or restart.

In addition, you need to know the username and password assigned on the computer (if installed). Without this information the process will not be possible.

Before you take any action, make sure that TCP port 445 is open in Windows Firewall on the computer you want to shutdown or restart.

To do this, go to “Control Panel” and “Security Center”. Then select the Windows Firewall option.

Go to the Exceptions tab. Typically, the option to allow file and printer sharing is already selected.

If it's not, select it and click OK. If you don't see the File and Printer Access line, click Add Port and select 445 TCP.

Then open Control Panel again. Select the System command and select Allow users to connect to this computer from the Remote tab.

Shut down or restart the computer using the Shutdown command

To restart or shut down your computer using Remote Desktop, you can use the shutdown command via the command line.

After launching Command Prompt, in a black window, type:

Next use the command:

  • /f - force restart (ignore interfering processes) of processes

After confirming with Enter, the system will inform you that the computer or laptop will restart in a moment.

In case of failure, I recommend running Command Term as Administrator, especially if User Account Control is activated.

Ending a user session

If the user wants to end the session and log in to the system under another account (guest, administrator), then for this you can use 2 equivalent commands: logoff or shutdown /l


There is no difference between them. Each of these commands performs the same action.

And, as reboot works in the command line, the session will also not be terminated instantly, but with a warning and a countdown of 60 seconds. Using the command option "/t 0" this can be done immediately.

How to restart or shut down a computer via - bat

If you frequently reboot your computer via remote desktop, it's a good idea to create a file (.bat) on your desktop.

To do this, create a “Text Document” (txt) and name it “Restart.bat”. In this case, you must have extensions enabled (otherwise you won’t see anything).

If you don't see the .bat extension, you should go to Folder Options and uncheck o.

Now enter the command in the created file (it is better to do this before renaming it to “Restart.bat”), for example - shutdown /r /f. Then we close, saving the changes and can run the file.

It can be used to automatically restart your computer, for example, every Saturday. Just set it to run at a specific time in the Task Scheduler.

Now you can move on to the main command, thanks to which you can shut down or restart your computer over the network.

For those who are not yet fully familiar with such procedures, here are a few commands for the drive, as an example: shutdown -a -f -t 30 - m \192.168.3.4/

At this stage, I recommend that you run: shutdown /? – you will be immediately shown all supported commands.

  1. So -a - the Shutdown command can be executed during the Shutdown Delay action.
  2. -f: Forces currently running applications to be shut down without warning.
  3. -t xx: Sets the countdown in seconds.
  4. -m\xxx.xxx.xxx.xxx: IP address of the target computer.
  5. Graphics are available after the command: Shutdown -i.

Shortcut to restart your computer

To execute a command faster, you can create a shortcut on the desktop, which, when clicked, automatically executes the programmed command. To do this you need:

  1. Right-click on a free area of ​​the desktop, select “Create”, specify “Shortcut”.

  2. A window will appear where you can specify which command will be executed when pressed. You must specify shutdown -s -t 0, click “Next”.

  3. Specify where to save the shortcut

Next, just double-click on the created shortcut, and the computer will immediately begin to reboot. It should be noted that in this case, command execution parameters are indicated not through the “/” symbol, but through “-”.

Super test on the topic “Money” and how can you be friends with it?

How to turn on or restart your computer using the Wake On Lan command

The Wake On Lan operation involves switching the system over the network by sending a Magic Packet to the network card of the target computer.

To perform this operation, the device you want to use to perform it must be connected to the same local area network (LAN) as the target one, that is, the one you want to turn on from a distance.

In addition, you must know the physical address (MAC address) and IP address of the destination PC. Without these elements, such an operation cannot be performed.

Program and terminology

DynDNS is a universal program for remotely rebooting a computer, which is distributed free of charge.

Features of the program are as follows:

  • Several second-level domains have been implemented;
  • Option to purchase a domain for a private network;
  • The resulting domain will be associated with a device without a static IP.

DNS is a resource name that replaces an IP address. Used to simplify perception and increase ease of use of devices.

A private network is a secure environment in which information is transferred directly from device to device.

The program in question can be used to quickly and conveniently reboot a remote computer. You will need to install a program where, using one option, you can quickly reboot the system.

Tip: to use the reboot program correctly, you must connect your PC to the Internet.

How to turn on a computer remotely using the WOL program

You need to download the Wake-on-LAN (WOL) program. This is what it looks like when you open it

Then fill out the required fields using the information you previously received.

  1. Mac Address: MAC address (target computer)
  2. Internet address: Local IP address (target computer)
  3. Subnet mask: 255.255.255.255
  4. Send Options: Local Subnet
  5. Remote port number: 8900
  6. Click the "Wake Me Up" button.

How to turn on a computer remotely over a network

Theoretically, after appropriate configuration of the router, you can turn on the computer via the Internet.

More specifically, it is about forwarding a UDP packet from a specific port to all devices connected to the network.

Only in practice does such a device allow such operations (IP address xxx255 for type C networks).

The process is done by sending a Magic Packet to your public IP address and corresponding port (as described above), which will shut down the computer.

One configuration provides access to all devices on a given network, but thanks to the appropriate settings, each of them can operate independently of the others.

Rating
( 2 ratings, average 4 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]