I am trying to adjust power/seep settings on windows 10 using a .bat file. I found that you can easily import a power scheme using the powercfg -import
however the issues is trying to set the power scheme as the active one. In order to use powercfg -setactive GUID
However, I need to know the GUID to set it as active. The GUID changes computer to computer though.
Here is what I am using to pull the output of powercfg /L
to put it into variables:
SETLOCAL ENABLEDELAYEDEXPANSION
SET count=1
FOR /F "tokens=* USEBACKQ" %%F IN (`powercfg.exe /L`) DO (
SET var!count!=%%F
SET /a count=!count!+1
)
ECHO %var1%
ECHO %var2%
ECHO %var3%
ENDLOCAL
I have no way of putting just the GUID into a variable to put into the set active command. I am unsure of how to pull out just a specific word or phrase. Any help would be appreciated.