2

Is there a way in windows to detect the event of pressing the physical power button, and after detecting the event execute or run a batch file. I basically
want to run a batch file that reboots the computer once the power button is pressed

1 Answers1

-1

You would need to know the scan code (section Power Saving) for the power button key. Once you have this, then you could use software like AutoHotkey to overwrite the behavior of the buttons scancode to execute a command or batch file once the button is pressed.