1

I want to run a application before my windows tablet go to sleep/hibernate mode when I hit power button. Actually it should be triggered before entering sleep/hibernate mode but I'm ok if hooks power button.

  • Would it be okay, to disable the powerbutton, and use a script that triggers the scheduled task (or script) and put your windows to sleep at the end of that script? Putting your windows to sleep would then require you to launch that script, which you can pin to your taskbar next to the start menu if you wanted. – LPChip Apr 26 '16 at 09:11
  • Wow that's awesome! But is there any possibility that I can run any script or application when hitting power button? I'm still used to push that side button for maybe just turning off the monitor. – user3819226 Apr 26 '16 at 09:19
  • Not sure if that is possible, thats why I asked if this alternative would be possible. By disabling the powerbutton, it would just have no effect when pressing it. The first 10 times you will automatically press it, then think, oh yeah... and do it the other way. Not optimal, but at least that works. I'll wait answering this one because it may very well be possible, but I lack that experience. – LPChip Apr 26 '16 at 09:56

1 Answers1

0

You can create a local computer policy on Windows. See the TechNet at http://technet.microsoft.com/en-us/magazine/dd630947

  1. Run gpedit.msc to open the Group Policy Editor,
  2. Navigate to Computer Configuration | Windows Settings | Scripts (Startup/Shutdown).

enter image description here

Source:

manjesh23
  • 1,682