How to make powercfg commands auto apply and not have to restart

1k Views Asked by At

I'm trying to make a batch file that will change the lid options on our laptops to "Do Nothing" The commands I am using are:

powercfg -SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

powercfg -SETDCVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

It will change the setting but it will only apply the setting after I restart the computer. Is there anyway I can do this without having to do a restart to apply the setting?

2

There are 2 best solutions below

0
On

I've managed to apply changes without restart by "re-setting" current power scheme after doing changes.

powercfg.exe -S SCHEME_CURRENT

In my case worked for power button actions

0
On

try typing %windir%\system32\rundll32.exe advapi32.dll,ProcessIdleTasks in an open CMD window.

hope that helped!