The Command Prompt is a feature built into all versions of Windows that allows you to execute MS-DOS ("MicroSoft Disk Operating System") and system commands within your computer. You can use the "Command Prompt" to shut down or restart a Windows computer remotely. The "Command Prompt" also allows you to access the "Remote Shutdown" dialog. To be able to shut down a Windows computer remotely, you must have access to the machine as a system administrator, and file and printer sharing must be enabled.
Steps
Method 1 of 4: Using the Command Prompt
Step 1. Access the "Start" menu by clicking on the icon
It features the Windows logo and is located in the lower left corner of the desktop.
Step 2. Type in the keyword cmd
A "Command Prompt" search will be performed within your computer and the results list will appear directly in the "Start" menu.
Step 3. Select the Command Prompt icon with the right mouse button
It is characterized by a black screen inside which a prompt in white characters is visible. Select the icon with the right mouse button to display the corresponding menu.
Step 4. Click on the Run as administrator option
The "Command Prompt" window will appear. The program will start with the access rights of the computer administrator.
To be able to perform this step, you must be logged in to Windows with a user account that is system administrator
Step 5. Type the shutdown command in the "Command Prompt" window
This is the command that allows you to shut down a Windows computer from the "Command Prompt".
To see the complete list of all the parameters of the "shutdown" command, execute the command shutdown /? within the "Command Prompt" window
Step 6. Enter the parameters m / computer_name
After entering the "shutdown" command, leave a space and enter the indicated parameters. Replace the keyword "computer_name" with the name of the computer you want to shut down remotely.
Step 7. Type the / s or / r parameter after the target computer name
Again, separate the parameter under consideration and the computer name with a blank space. If you need to shut down your computer, use the "/ s" parameter. If you want to restart it instead, use the "/ r" parameter.
Step 8. Add the / f parameter
After entering the characters "/ s" or "/ r", enter a blank space as a separator. Doing so will force close all open and running programs on the remote computer.
-
Note:
in this scenario, by forcing the shutdown of running programs, the user who is using the computer could lose his work if he did not save it in advance. Read on to find out how to warn the user about the imminent shutdown or restart of the machine they are working on and how to give them time to save all their data.
- At this point, the complete command should look like this: shutdown / workspace1 / r / f. Press the Enter key to execute the command and remotely restart the indicated computer. In this case, the restart will be performed immediately. Read on to add a timer before the computer restarts and to alert you with a message.
Step 9. Add the / c parameter
Insert a blank space after the "/ f" parameter before inserting the one indicated. This way, you can send a message to the user who is currently using the computer that you want to reboot or shut down remotely.
Step 10. Type the message you want in quotation marks
Again, first leave a blank after the "/ c" parameter. The message is intended to alert the user that the computer they are working on will be restarted or shut down. For example, you could use the message "This computer is about to restart, please immediately save all your work". Be sure to enclose the warning message in quotation marks ("").
Step 11. Add the / t parameter followed by a time interval in seconds
Again, type blank space first to separate the new command parameter from the old one. This will give the user time (indicated by the number of seconds you have chosen) to save all their data before the computer is restarted or shut down. For example, the / t 60 parameter delays the execution of the command by 60 seconds, after which the computer will be shut down or restarted.
Step 12. Press the Enter key
The command will be executed. At this point the complete command should look like this: shutdown m / workspace1 / r / f / c "This computer will restart in 60 seconds. Please save all your work immediately." / t 60.
- If a message similar to the following appears Access Denied or Access denied, make sure you are logged in to Windows with a system administrator account and have the same access rights on the target computer as well. Refer to the third method of the article to find out how to enable file and printer sharing on both computers by changing the Windows Firewall settings.
- If you do not have the possibility to connect to the registry of the target computer, refer to the fourth method of the article to find out how to do it and how to modify it remotely.
Method 2 of 4: Using the Remote Shutdown Dialog
Step 1. Access the "Start" menu by clicking on the icon
It features the Windows logo and is located in the lower left corner of the desktop.
Step 2. Type in the keyword cmd
A "Command Prompt" search will be performed within your computer and the results list will appear directly in the "Start" menu.
Step 3. Select the Command Prompt icon with the right mouse button
It is characterized by a black screen inside which a prompt in white characters is visible. Select the icon with the right mouse button to display the corresponding menu.
Step 4. Click on the Run as administrator option
The "Command Prompt" window will appear. The program will start with the access rights of the computer administrator.
To be able to perform this step, you must be logged in to Windows with a user account that is the system administrator
Step 5. Type the command shutdown -i in the "Command Prompt" window and press the Enter key
The "Remote Shutdown" dialog will be displayed.
Step 6. Click the Add button
It is located to the right of the "Computer" text box.
Step 7. Type the IP address of the target computer (or computers), then click the OK button
The target computer is the machine you want to reboot or shut down remotely. Enter the IP address of the computer in question in the "Add Computer" pop-up, then click on the button OK.
If you don't know the local IP address of the target computer, you can find this information using your computer and these instructions
Step 8. Choose whether to restart or shut down the target computer
Use the "Choose one of the following options:" drop-down menu to select "Shut Down" or "Restart".
Step 9. Click the check button
"Notify users" (optional).
This step allows you to set a timer before the computer is actually shut down or restarted.
Step 10. Type the number of seconds to wait before the computer actually turns off (optional)
Enter the chosen value in the text field "Display warning for [number] seconds". In this way, the execution of the shutdown command will be delayed by the indicated number of seconds.
Step 11. Click the check button
"Planned" (optional).
This step allows you to track the remote reboot or shutdown within the target machine's event log.
Step 12. Select the reason for the forced shutdown or restart (optional)
Use the "Option" drop-down menu to select the reason why remote shutdown or reboot was required. For example "Hardware: maintenance (planned)".
Step 13. Add a comment (optional)
This message will be displayed on the target computer screen. For example, you can use a message similar to the following: "This computer will be shut down in 60 seconds. Please immediately save all your work".
Step 14. Click the OK button
The shutdown or restart command will be executed.
- If a message similar to the following appears Access Denied or Access denied, make sure you are logged in to Windows with a system administrator account and have the same access rights on the target computer as well. Refer to the third method of the article to find out how to enable file and printer sharing on both computers by changing the Windows Firewall settings.
- If you do not have the possibility to connect to the registry of the target computer, refer to the fourth method of the article to find out how to do it and how to modify it remotely.
Method 3 of 4: Enable File and Printer Sharing Using the Windows Firewall
Step 1. Go to the Windows "Control Panel"
To perform this step follow these instructions:
- Click on the Windows "Start" menu icon;
- Type in the control panel keywords;
- Click on the icon Control panel.
Step 2. Click on the Network and Internet link
It is green in color and placed next to an icon depicting two computer screens and a globe.
If the indicated link is not visible, skip this step
Step 3. Click on the Network and Sharing Center option
It is characterized by an icon depicting four computers connected to each other.
Step 4. Click the Change Advanced Sharing Settings link
It is displayed on the left side of the "Control Panel" window.
Step 5. Click on the radio button Enable Network Discovery
This will enable the "Network Discovery" feature.
Step 6. Click on the radio button Enable file and printer sharing
This will enable file and printer sharing on your computer.
Step 7. Click the Save Changes button
It is located in the lower right corner of the window.
Step 8. Click on the Network and Internet link
It is displayed in the address bar of the "Control Panel" window. You will be redirected back to the "Network and Internet" screen of the "Control Panel".
Step 9. Click on the System and Security option
It is located on the left side of the window.
Step 10. Click the Allow app through Windows Firewall link
It is the second entry listed under the "Windows Defender Firewall" link.
Step 11. Click the check button
located next to "File and Printer Sharing".
It is one of the options listed in the "Allowed apps and features" section.
Step 12. Click the check button
"Private".
It is located to the right of the "File and Printer Sharing" option within the "Allowed apps and features" section.
Step 13. Click the OK button
It is located at the bottom of the "Control Panel" window. This way, the changes will be saved and applied.
Method 4 of 4: Edit the Windows Registry
Step 1. Access the "Start" menu by clicking on the icon
It features the Windows logo and is located in the lower left corner of the desktop. In new versions of Windows, when trying to log into a computer remotely, system administrator access privileges are often removed. To work around this problem, you need to manually edit the Windows registry.
Step 2. Type the keyword regedit into the "Start" menu
The Windows Registry Editor icon will appear.
-
Attention:
modifying or deleting keys and items contained in the Windows registry can irreparably damage the operating system. For this reason, proceed with extreme caution and attention.
Step 3. Click on the Regedit icon
The Windows Registry Editor window will appear.
Step 4. Access the "System" folder contained in the "Policies" directory
To navigate the Windows registry, you can use the tree menu displayed in the left pane of the editor window. Follow these instructions to access the contents of the "System" folder stored in the "Policies" directory:
- Double-click the entry HKEY_LOCAL_MACHINE;
- Double-click the folder SOFTWARE;
- Double-click the folder Microsoft;
- Double-click the folder Windows;
- Double-click the folder CurrentVersion;
- Double-click the folder Policies;
- Double-click the folder System.
Step 5. Create a new "DWORD" value
Follow these instructions to create a new "DWORD" value inside the "System" folder.
- Right-click an empty spot in the main frame of the Registry Editor window;
- Move the mouse pointer over the item New one;
- Click on the DWORD (32-bit) Value option.
Step 6. Name the DWORD value you just created "LocalAccountTokenFilterPolicy"
When you create a new DWORD entity, the temporary name appears highlighted in blue. To rename it, simply type in the new name, which is "LocalAccountTokenFilterPolicy".
Step 7. At this point, right-click on LocalAccountTokenFilterPolicy
A context menu will appear to the right of the chosen value.
Step 8. Click on the Edit option
A new pop-up will appear that will allow you to edit the DWORD value you created.
Step 9. Set the value of the new DWORD entity to "1"
Use the "Value data" text field to change the present value from "0" to "1".
Step 10. Click the OK button
The new DWORD entity value will be stored. At this point you can close the Registry Editor window.
Advice
- In order to use the procedures described in the article, you should know the IP address of the target computer.
- Type the command shutdown /? within the "Command Prompt" to view the complete list of all the parameters it provides.