I need a bat file of power managment
Moderator: DosItHelp
-
- Posts: 6
- Joined: 17 May 2016 08:06
I need a bat file of power managment
Guys can you help me create a bat file to set my cpu power percentage every time i reboot...
Every time i reboot it turns to default 100% minimum state and 100% maximum state... i need lower, i need to be able to set the values.
i found the instructions for the power managment but i can't do this my self...
can you write for me a bat file to set those values please?
i use win 8 and win 7, two laptops
thanks guys!
Every time i reboot it turns to default 100% minimum state and 100% maximum state... i need lower, i need to be able to set the values.
i found the instructions for the power managment but i can't do this my self...
can you write for me a bat file to set those values please?
i use win 8 and win 7, two laptops
thanks guys!
Re: I need a bat file of power managment
Unfortunately there is no language independent solution.
I tested with the German settings that work for me.
I also commented the English settings that I expect to work on an English Windows OS.
If you don't know the right names for your language then open a CMD window and run
in order to find out these names.
Regards
aGerman
Code: Select all
@echo off &setlocal
:: German
set "scheme_name=Ausbalanciert"
set "sub_name=Prozessorenergieverwaltung"
set "min_setting_name=Minimaler Leistungszustand des Prozessors"
set "max_setting_name=Maximaler Leistungszustand des Prozessors"
:: English
::set "scheme_name=Balanced"
::set "sub_name=Processor power management"
::set "min_setting_name=Minimum processor state"
::set "max_setting_name=Minimum processor state"
for /f "tokens=2 delims=:" %%i in ('powercfg -l^|findstr /ic:"%scheme_name%"') do for /f %%j in ("%%i") do set "scheme_guid=%%j"
echo scheme_guid %scheme_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid%^|findstr /ic:"%sub_name%"') do for /f %%j in ("%%i") do set "sub_guid=%%j"
echo sub_guid %sub_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%min_setting_name%"') do for /f %%j in ("%%i") do set "min_setting_guid=%%j"
echo min_setting_guid %min_setting_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%max_setting_name%"') do for /f %%j in ("%%i") do set "max_setting_guid=%%j"
echo max_setting_guid %max_setting_guid%
echo(&echo !!! Do only continue if all four guids were found !!!
pause
:: On battery min -> 0%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: Plugged in min -> 0%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: On battery max -> 100%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 100
:: Plugged in max -> 100%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 100
pause
I tested with the German settings that work for me.
I also commented the English settings that I expect to work on an English Windows OS.
If you don't know the right names for your language then open a CMD window and run
Code: Select all
powercfg -q|more
in order to find out these names.
Regards
aGerman
-
- Posts: 6
- Joined: 17 May 2016 08:06
Re: I need a bat file of power managment
aGerman wrote:Unfortunately there is no language independent solution.Code: Select all
@echo off &setlocal
:: German
set "scheme_name=Ausbalanciert"
set "sub_name=Prozessorenergieverwaltung"
set "min_setting_name=Minimaler Leistungszustand des Prozessors"
set "max_setting_name=Maximaler Leistungszustand des Prozessors"
:: English
::set "scheme_name=Balanced"
::set "sub_name=Processor power management"
::set "min_setting_name=Minimum processor state"
::set "max_setting_name=Minimum processor state"
for /f "tokens=2 delims=:" %%i in ('powercfg -l^|findstr /ic:"%scheme_name%"') do for /f %%j in ("%%i") do set "scheme_guid=%%j"
echo scheme_guid %scheme_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid%^|findstr /ic:"%sub_name%"') do for /f %%j in ("%%i") do set "sub_guid=%%j"
echo sub_guid %sub_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%min_setting_name%"') do for /f %%j in ("%%i") do set "min_setting_guid=%%j"
echo min_setting_guid %min_setting_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%max_setting_name%"') do for /f %%j in ("%%i") do set "max_setting_guid=%%j"
echo max_setting_guid %max_setting_guid%
echo(&echo !!! Do only continue if all four guids were found !!!
pause
:: On battery min -> 0%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: Plugged in min -> 0%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: On battery max -> 100%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 100
:: Plugged in max -> 100%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 100
pause
I tested with the German settings that work for me.
I also commented the English settings that I expect to work on an English Windows OS.
If you don't know the right names for your language then open a CMD window and runCode: Select all
powercfg -q|more
in order to find out these names.
Regards
aGerman
many Thenks!
one of this days i'll try to figure out the names... perhaps i'm gonna need more help:)
-
- Posts: 6
- Joined: 17 May 2016 08:06
Re: I need a bat file of power managment
Please someone can make it work for english machine? i still haven't solved the problem...
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: I need a bat file of power managment
Those are the English names... (except obviously change the second "Minimum processor state" to "Maximum processor state" but that's clearly just a typo)
Re: I need a bat file of power managment
energysavior wrote:Please someone can make it work for english machine? i still haven't solved the problem...
Did you follow the advice given and change the code provided here:
aGerman wrote:Code: Select all
@echo off &setlocal
:: German
set "scheme_name=Ausbalanciert"
set "sub_name=Prozessorenergieverwaltung"
set "min_setting_name=Minimaler Leistungszustand des Prozessors"
set "max_setting_name=Maximaler Leistungszustand des Prozessors"
:: English
::set "scheme_name=Balanced"
::set "sub_name=Processor power management"
::set "min_setting_name=Minimum processor state"
::set "max_setting_name=Minimum processor state"
to
Code: Select all
@echo off &setlocal
:: German
::set "scheme_name=Ausbalanciert"
::set "sub_name=Prozessorenergieverwaltung"
::set "min_setting_name=Minimaler Leistungszustand des Prozessors"
::set "max_setting_name=Maximaler Leistungszustand des Prozessors"
:: English
set "scheme_name=Balanced"
set "sub_name=Processor power management"
set "min_setting_name=Minimum processor state"
set "max_setting_name=Maximum processor state"
-
- Posts: 6
- Joined: 17 May 2016 08:06
Re: I need a bat file of power managment
I copy the code to a text file and then I rename it .bat ... I double click it and it runs, and say
scheme_guid 381b4222-f694-41f0-9685-ff5bb260df2e
sub_guid 54533251-82be-4824-96c1-47b60b740d00
min_setting_guid 893dee8e-2bef-41e0-89c6-b55d0929964c
max_setting_guid bc5038f7-23e0-4960-96da-33abaf5935ec
!!! Do only continue if all four guids were found !!!
Press any key to continue . . .
i press a key and nothing change on the energy plan :/
what i do wrong guys?!
scheme_guid 381b4222-f694-41f0-9685-ff5bb260df2e
sub_guid 54533251-82be-4824-96c1-47b60b740d00
min_setting_guid 893dee8e-2bef-41e0-89c6-b55d0929964c
max_setting_guid bc5038f7-23e0-4960-96da-33abaf5935ec
!!! Do only continue if all four guids were found !!!
Press any key to continue . . .
i press a key and nothing change on the energy plan :/
what i do wrong guys?!
-
- Posts: 6
- Joined: 17 May 2016 08:06
Re: I need a bat file of power managment
this is the actual code i use:
@echo off &setlocal
:: German
set "scheme_name=Ausbalanciert"
set "sub_name=Prozessorenergieverwaltung"
set "min_setting_name=Minimaler Leistungszustand des Prozessors"
set "max_setting_name=Maximaler Leistungszustand des Prozessors"
:: English
set "scheme_name=Balanced"
set "sub_name=Processor power management"
set "min_setting_name=Minimum processor state"
set "max_setting_name=Maximum processor state"
for /f "tokens=2 delims=:" %%i in ('powercfg -l^|findstr /ic:"%scheme_name%"') do for /f %%j in ("%%i") do set "scheme_guid=%%j"
echo scheme_guid %scheme_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid%^|findstr /ic:"%sub_name%"') do for /f %%j in ("%%i") do set "sub_guid=%%j"
echo sub_guid %sub_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%min_setting_name%"') do for /f %%j in ("%%i") do set "min_setting_guid=%%j"
echo min_setting_guid %min_setting_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%max_setting_name%"') do for /f %%j in ("%%i") do set "max_setting_guid=%%j"
echo max_setting_guid %max_setting_guid%
echo(&echo !!! Do only continue if all four guids were found !!!
pause
:: On battery min -> 0%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: Plugged in min -> 0%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: On battery max -> 50%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %max_setting_name% 50
:: Plugged in max -> 50%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %max_setting_name% 50
pause
___________________________________________________________________________
and i receive 2 times invalid parameter... i can't copy paste that
@echo off &setlocal
:: German
set "scheme_name=Ausbalanciert"
set "sub_name=Prozessorenergieverwaltung"
set "min_setting_name=Minimaler Leistungszustand des Prozessors"
set "max_setting_name=Maximaler Leistungszustand des Prozessors"
:: English
set "scheme_name=Balanced"
set "sub_name=Processor power management"
set "min_setting_name=Minimum processor state"
set "max_setting_name=Maximum processor state"
for /f "tokens=2 delims=:" %%i in ('powercfg -l^|findstr /ic:"%scheme_name%"') do for /f %%j in ("%%i") do set "scheme_guid=%%j"
echo scheme_guid %scheme_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid%^|findstr /ic:"%sub_name%"') do for /f %%j in ("%%i") do set "sub_guid=%%j"
echo sub_guid %sub_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%min_setting_name%"') do for /f %%j in ("%%i") do set "min_setting_guid=%%j"
echo min_setting_guid %min_setting_guid%
for /f "tokens=2 delims=:" %%i in ('powercfg -q %scheme_guid% %sub_guid%^|findstr /ic:"%max_setting_name%"') do for /f %%j in ("%%i") do set "max_setting_guid=%%j"
echo max_setting_guid %max_setting_guid%
echo(&echo !!! Do only continue if all four guids were found !!!
pause
:: On battery min -> 0%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: Plugged in min -> 0%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %min_setting_guid% 0
:: On battery max -> 50%
powercfg /setdcvalueindex %scheme_guid% %sub_guid% %max_setting_name% 50
:: Plugged in max -> 50%
powercfg /setacvalueindex %scheme_guid% %sub_guid% %max_setting_name% 50
pause
___________________________________________________________________________
and i receive 2 times invalid parameter... i can't copy paste that
-
- Posts: 6
- Joined: 17 May 2016 08:06
Re: I need a bat file of power managment
with the above code i can set only the minimum ! the maximum does not change plugged and unplugged
some more help here guys :-)
EDIT
thank you all!!! guid guid !
some more help here guys :-)
EDIT
thank you all!!! guid guid !
-
- Posts: 240
- Joined: 04 Mar 2014 11:14
- Location: germany
Re: I need a bat file of power managment
Hi energysavior,
Create one or several energy saving plans and use this script to change the presets.
https://www.administrator.de/wissen/win-7-energiesparplan-direkter-rotierender-wechsel-in-taskleiste-168151.html
https://translate.google.de/translate?sl=de&tl=en&js=y&prev=_t&hl=de&ie=UTF-8&u=https%3A%2F%2Fwww.administrator.de%2Fwissen%2Fwin-7-energiesparplan-direkter-rotierender-wechsel-in-taskleiste-168151.html&edit-text=
Phil
Create one or several energy saving plans and use this script to change the presets.
https://www.administrator.de/wissen/win-7-energiesparplan-direkter-rotierender-wechsel-in-taskleiste-168151.html
https://translate.google.de/translate?sl=de&tl=en&js=y&prev=_t&hl=de&ie=UTF-8&u=https%3A%2F%2Fwww.administrator.de%2Fwissen%2Fwin-7-energiesparplan-direkter-rotierender-wechsel-in-taskleiste-168151.html&edit-text=
Phil