
Accidentally shutting down or restarting your Windows? Afraid you will lost all the unsaved files? Okay, you can still stop the shutting, restarting progress by executing below command using command prompt. Of course, you need to be very fast to enter the command.
shutdown -a
You can also create a shortcut on your desktop so you can react to the stop the shutdown/restart quickly.
1. Right click on your Desktop. Choose New > Shortcut.
2. On the location, type in below command.
cmd /k shutdown -a
3. Enter the name of the shortcut. Example, Abort Shutdown and click on Finish. So, you can just click on the Abort Shutdown shortcut every time to stop the shutdown or restart.
Note
In Windows 7, you can prevent yourself from accidentally hitting the power button and shutting down the system. To do this, go to Control Panel. Search for “Power” and click on “Change what the power buttons do”. Look for “When I press the power button”, set “Do nothing” on battery and during plugged in. So, anytime, you press the power button, the Windows will do nothing and no more accidents!

