Reboot Remote Computer Through Command Line
Command SHUTDOWN used to end a user session, restart the computer, put it into sleep mode, or turn off the power. With the appropriate permissions, the command can be executed for the remote system.
Command line format:
SHUTDOWN.EXE [/ i | / l | / s | / r | / g | / a | / p | / h | / e] [/ f] [/ m \\ computer] [/ t xxx] [/ d [p | u] xx: yy [/ c “a comment”]]
If no options are specified on the command line, or if a parameter is specified /?. then a brief help on using the command is displayed on the screen.
Instead of syntax /key allowed to use -key:
SHUTDOWN.EXE [-i.l.s.r.g.a.p.h.e] [-f] [-m \\ computer] [- t xxx] [- d [p | u] xx: yy [-c “a comment”]]
Command line options:
/ i. Display a graphical user interface. This parameter must be the first.
/ l. The end of the session. This parameter cannot be used with parameters / m or / d.
/ s. Shutting down the computer.
/ r. Shutting down and restarting the computer.
/ g. Shutting down and restarting the computer. After restarting the system, launch all registered applications.
/ a. Cancel system shutdown. This parameter can only be used during the waiting period.
/ p. Shut down the local computer immediately without warning. Can be used with parameters / d and / f.
/ h. Switching the local computer to hibernation mode. Can be used with parameter / f.
/ e. Indicate the reason for the unexpected shutdown of the computer.
/ o. Go to the menu of additional boot options and restart the computer. This parameter is valid for Windows 8 and later. Must be used with the / r option.
/ m \\ computer. The name or IP address of the destination computer.
/ t xxx. Set the delay in xxx seconds before shutting down the computer. Valid Range: 0-315360000 (10 years); default value: 30 seconds. If the timeout period is greater than 0, the parameter is applied / f.
/ c “a comment”. Commentary on the reason for restarting or shutting down. The greatest length. 512 characters.
/ f. Force shutdown of running applications without warning users. Parameter / f used if for parameter / t set value greater than 0.
/ d [p | u:] xx: yy You must provide a reason for rebooting or shutting down. “p” means a scheduled reboot or shutdown. “u” means the reason is user defined. If no “p”nor “u”A reboot or shutdown is unplanned. xx is the main reason code (a positive integer less than 256). yy is an auxiliary reason code (a positive integer less than 65536).
To manage shutdown and reboot processes, the user must have administrator rights with respect to the managed system.
Examples of using the SHUTDOWN command:
shutdown or shutdown /?. display help for using the command.
shutdown / s. turn off the computer after 30 seconds. The user will be warned of a scheduled shutdown.
shutdown / s / t 0. turn off the power of the computer immediately.
shutdown / s / t 60 / m \\ COMP7. turn off the power of the COMP7 computer after 60 seconds.
shutdown / s / t 60 / m \\ 192.168.0.1. turn off the power of the computer with the IP address 192.168.0.1 after 60 seconds. If necessary, a user with administrator rights can cancel the shutdown process with the command shutdown.a
shutdown / h. put the computer in hibernation mode. When the command is executed, all information from the RAM (processes, programs, data) is stored in a special file hyberfil.sys, located in the root directory of the system drive and performs normal power off. The next time you turn on the computer, the Windows Boot Manager (BOOTMGR) will restore the system state from the file hyberfil.sys. The hibernation transfer mode must be enabled for this computer, for example with the command powercfg / H on or using snap “Power supply” Windows Control Panel Also, it must be borne in mind that the implementation of this mode will require a large amount of free space on the hard disk for a copy of RAM.
shutdown / l. end the session of the current user. The session termination command can only be executed on the local computer and only for the current user. Similar to running a command logoff without parameters.
shutdown / r. reboot the local computer. By default, a reboot will be performed after 30 seconds if the parameter is not specified / t
shutdown / r / o / t 0. restart the local computer immediately (t 0 , with the ability to select additional options (/ o. After a reboot, the menu for selecting actions is displayed on the screen, with which you can either continue the normal boot, or select additional modes for diagnostics and system recovery. Parameter / o valid for operating systems Windows 8 and later.
shutdown / r / m \\ 192.168.0.1. restart the computer with the IP address 192.168.0.1.
shutdown / g. reboot and restore applications registered using the API function RegisterApplicationRestart. It is usually used when updating the system, when during the installation process a reboot is necessary with the continuation of the installation process.
shutdown / r / c “Scheduled Reboot” / d P: 12: 555. restart the computer with a message displayed “Scheduled Reboot” and logging the reasons. “Planned”, main code. “12” (0x0B), optional code. “555” (0x022b).
shutdown / i. running graphical utility shutdown.exe. Is displayed on the screen “Remote Shutdown Dialog”.
To perform a shutdown, reboot or end a user session, enter the name or IP address of the computer using the button “Add”, select the desired action, reason and fill in the field “A comment”, the text from which will be displayed in the information message about the planned action. For most reasons, the comment field is required, and without filling in the button “Ok” will be inactive.
In Windows 7 and later, remotely shutting down or rebooting using the command shutdown, may fail with an “Access Denied (5)” error even if you have administrator rights and enable forced remote shutdown in local group policies. In addition, when accessing hidden administrative resources C, Admin. etc. The remote computer is prompted for a username and password, but the connection fails with access denied. The problem is solved by removing the computer from the home network and adding (changing) the registry parameter to the section:
hklm \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System
need to add parameter LocalAccountTokenFilterPolicy , arrogant dword: 00000001
After entering the data into the registry, a reboot is required to apply the changes.
Power management at the Windows command prompt. POWERCFG team
If you want to share a link to this page on your social network, use the button “Share this”