I have a Media PC that needs to ignore power on/off commands sent by Logitech Harmony remote (Media Centre profile) when the PC is switched on. The idea behind it is that when the PC on, sending IR power command doesn't put it to sleep. But when the PC is off, IR power command will wake it up. Putting the PC to sleep is achieved by mapping a completely irrelevant IR command to run a simple .bat script that engages the sleep mode.
Normally this can be easily achieved by going into Power Options > Change Plan Settings > Change Advanced Power Settings > Power Buttons and Lid > Sleep Button Action and set it to Do nothing.
The problem with this is that the setting for some reason doesn't stick. Every now and then Sleep Button Action for no apparent reason reverts to Sleep...
I resolved the issue by forcing this option with via group policy:
- Open Group Policy Editor (gpedit.msc)
- Navigate to Computer Configuration > Administrative Templates > System > Power Management > Button Settings
- Enable Select the Sleep Button Action (Plugged In) and set Sleep Button Action to Take no Action
If you now go back to Power Settings, you will see that Sleep Button Action is now set to Do Nothing and it's impossible to change it.
This did the trick for me. Whatever process was re-setting the Sleep option, it was not longer able to do this.
Windows 7 Pro