Solution to remote restart through command when window cannot be connected remotely

Preliminary explanation: During one use, I found that a Windows system cannot be connected remotely, but it can be pinged. After remote access, it is in a black screen state, so I intend to restart it by remote command.
Instructions:
Use the command line to remotely restart, enter in the cmd command line state:
shutdown -r -m \1.1.1.1 -t 0 -f 
-r restart, -m remote device address, -f force restart;
During the execution process, a prompt of denying access to <5> may appear, indicating that there is no permission, then enter the following command:
Using a valid user name and password, execute the shutdown command again to restart.
net use \1.1.1.1\ipc$ "password" /user:"username"
shutdown -r -m \1.1.1.1 -t 0 -f 
Prompt that the execution is successful.

----------------Dividing line-----------------

The following parameters are added to the shutdown command, which can be viewed with help shutdown:
Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
[/m \computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]
No parameters. Help is displayed. This is the same as typing /?. /? Show help. This is the same as not typing any options. /i Displays the graphical user interface (GUI).
           This must be the first option. /l Log off. This cannot be used with the /m or /d option. /s Shut down the computer. /r Shut down and restart the computer. /g Shut down and restart the computer. After the system restarts,
           Restart all registered applications. /a Abort system shutdown.
           This can only be used during the timeout period. /p Shut down the local computer without timeout or warning.
           Can be used with the /d and /f options. /h Hibernate the local computer.
           Can be used with the /f option. /e Records the reason the computer shuts down unexpectedly. /m \\computer Specify the target computer. /t xxx Set the timeout before closing to xxx seconds.
           The valid range is 0-315360000 (10 years), and the default value is 30.
           If the timeout time is greater than 0, it will imply /f
           parameter. /c "comment" Comment on the reason for the restart or shutdown.
           Up to 512 characters are allowed. /f Forces the running application to close without warning the user in the foreground.
           When specifying a value greater than 0 for the /t parameter,
           The /f parameter is implied. /d [p|u:]xx:yy Provide the reason for restart or shutdown.
           p indicates that the restart or shutdown is planned.
           u indicates that the reason is defined by the user.
           If neither p nor u is specified, it is an unplanned restart
           Or close.
           xx is the main reason number (a positive integer less than 256).
           yy is the minor reason number (a positive integer less than 65536).


Reason on this computer:
(E = expected U = unexpected P = planned, C = custom)
Category Major Minor Title

U 0 0 Others (unplanned)
E 0 0 Others (unplanned)
EP 0 0 Others (planned)
U 0 5 Other faults: System does not respond
E 1 1 Hardware: Maintenance (unplanned)
EP 1 1 Hardware: Maintenance ( Planned)
E 1 2 Hardware: Installation (unplanned)
EP 1 2 Hardware: Installation (planned)
E 2 2 Operating system: Recovery (planned)
EP 2 2 Operating system: Recovery (planned)
P 2 3 Operating system : Upgrade (planned)
E 2 4 Operating system: Reconfigure (unplanned)
EP 2 4 Operating system: Reconfigure (planned)
P 2 16 Operating system: Service Pack (planned)
2 17 Operating system: Hot patch ( Unplanned)
P 2 17 Operating system: Hot patch (planned)
2 18 Operating system: Security patch (unplanned)
P 2 18 Operating system: Security patch (planned)
E 4 1 Application: Maintenance (unplanned)
EP 4 1 Application: Maintenance (planned)
EP 4 2 Application: Installation (planned)
E 4 5 Application : No response
E 4 6 Application: Unstable
U 5 15 System failure: Stop error
U 5 19 Security issue
E 5 19 Security issue
EP 5 19 Security issue
E 5 20 Network connection loss (unplanned)
U 6 11 Power failure: The wire is unplugged
U 6 12 Power failure: Environment
P 7 0 Old version API shutdown


Guess you like

Origin blog.51cto.com/13687405/2607088