1

I want to run a script that reboots the computer when the shutdown button is clicked on Windows 10 . I have tried this solution https://stackoverflow.com/questions/12434863/executing-a-batch-script-on-windows-

this is the batch script I am using

shutdown -r -f -t 0

However this doesn't work . Is there a way achieve this ,if so please let me know

1 Answers1

1

Go into windows task scheduler.

  1. Create a basic task.
  2. Enter a Name and Description, click next
  3. You should now be in the trigger option. Set the trigger as "When a specific event is logged" and click next.
  4. In the Log drop down, choose "system"
  5. In the Source dropdown, select "Kernal-power"
  6. and in the Event ID, put in "109"

After that, click next for start a program and then load your script in. This should run the script before the shutdown command has been executed. I could be wrong, but these steps should point you in the right direction.

I'm also sure that a quick regedit would be able disable the shutdown button.

edit

Here is that regedit fix that might meet your needs. http://www.intowindows.com/how-to-remove-shutdown-restart-hibernate-options-from-start-menu-shutdown-dialog-box/