I made a batch that generates INI file to lower voltage to -90mV (if previous INI not present or NEW parameter is used) and creates a Scheduled Task that will run ThrottleStop.EXE after few seconds of Wakeup/resume from sleep/hibernate, and at boot. ThrottleStop will only run for 20 seconds (windows will kill it, no need to use inner ExitTime INI setting). Some help provided within batch. Will ask for admin rights if needed.
Code:
@echo off
rem BD procHot default enabled: 0x00300020; disabled: 0x00300000
set procHot=0x00300020
rem mVolt -49.8 -60.5 -70.3 -80.1 -89.8 -100.6 -110.4 -120.1 -125
rem 0xF9B00000 0xF8400000 0xF7100000 0xF5C00000 0xF4800000 0xF3200000 0xF1E00000 0xF0A00000 0xF0000000
set voltage=0xF4800000
echo .
echo . throttleStopOnWakeUp.bat v23.0412 by isidroco
echo .
echo . Creates ThrottleStop.exe scheduled task on logon/wakeup
echo . Parameters:
echo . new: Generates ThrottleStop.ini with -90mV
echo . nopause: self described
echo .
echo . Needs throttleStop.exe and win7 or later
echo . BDProcHot and Voltage can be changed in first lines
echo . Will autorequire admin privileges if needed
echo .
echo .
setlocal enableextensions enabledelayedexpansion & REM to get var value at exec with !varNm!
set PARAM=%* _& REM _ avoid PARAM being empty if no param passed, %* are rest of parameters passed
rem set PARAM=%PARAM: =%& REM delete all spaces
rem echo PARAM:!PARAM!
REM Run as admin; https://stackoverflow.com/questions/7044985/how-can-i-auto-elevate-my-batch-file-so-that-it-requests-from-uac-administrator/12264592#12264592
net file 1>NUL 2>NUL
if not '%errorlevel%' == '0' (
REM ELEVATE PRIVILEGES AND SELF-RUN AGAIN
powershell Start-Process -FilePath "%0" -ArgumentList "%PARAM%" -verb runas >NUL 2>NUL
exit /b
)
rem Verify Admin rights
net file 1>NUL 2>NUL
if not '%errorlevel%' == '0' (
echo . Must execute as administrator !!!
goto :PAUSEFIN
)
REM Change directory to current script. "runas" starts in C:\Windows\System32
cd /d %~dp0
REM echo Current path is %cd%
rem Find EXE: try 1st batch path, try then with FOR dir list
echo . 1- Locate EXE
set throttleDir=%homedrive%:\UT\Info\
FOR %%P in ( "%cd%" "%homedrive%:\UT" "%throttleDir%" ) do (
set "throttleDir=%%~P"& REM eliminate outside quotes"
rem echo !throttleDir!
IF exist "!throttleDir!\ThrottleStop.exe" GOTO :throttleFound
)
echo . ThrottleStop.exe not found
goto :PAUSEFIN
:throttleFound
echo . Found OK: !throttleDir!\ThrottleStop.exe
echo .
rem new parameter generates a new ini, old one moved to in0
IF not "%PARAM:new=%"=="%PARAM%" if exist "!throttleDir!\ThrottleStop.ini" (
echo . Move original .ini to .in0
del "!throttleDir!\ThrottleStop.in0" 2>nul
ren "!throttleDir!\ThrottleStop.ini" *.in0
)
IF exist "!throttleDir!\ThrottleStop.ini" (
echo . 2- INI Already present !throttleDir!\ThrottleStop.ini
) else (
echo . 2- Generating "!throttleDir!\ThrottleStop.ini" temp file
(
echo\[ThrottleStop]
echo\Options1=!procHot!
echo\;ExitTime=15
echo\FIVRVoltage00=!voltage!
echo\FIVRVoltage20=!voltage!
echo\UnlockVoltage00=1
echo\UnlockVoltage20=1
) > "!throttleDir!\ThrottleStop.ini"
echo . Generated new INI file
)
echo .
echo . 3- Generating XML task description temp file
(
echo\^<?xml version="1.0" encoding="UTF-16"?^>
echo\^<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"^>
echo\ ^<RegistrationInfo^>
echo\ ^<Date^>2023-04-12T11:04:36.8708211^</Date^>
echo\ ^<Author^>isidroco^</Author^>
echo\ ^<Description^>Saves energy, reduces throtling by lowering CPU voltage, runs on wakeup and boot for 20 seconds^</Description^>
echo\ ^<URI^>\throttleStopOnWakeUp^</URI^>
echo\ ^</RegistrationInfo^>
echo\ ^<Triggers^>
echo\ ^<BootTrigger^>
echo\ ^<Enabled^>true^</Enabled^>
echo\ ^<Delay^>PT16S^</Delay^>
echo\ ^</BootTrigger^>
echo\ ^<EventTrigger^>
echo\ ^<Enabled^>true^</Enabled^>
echo\ ^<Subscription^>^<QueryList^>^<Query Id="0" Path="System"^>^<Select Path="System"^>*[System[Provider[@Name='Microsoft-Windows-Kernel-General'] and EventID=1]]^</Select^>^</Query^>^</QueryList^>^</Subscription^>
echo\ ^<Delay^>PT11S^</Delay^>
echo\ ^</EventTrigger^>
echo\ ^</Triggers^>
echo\ ^<Principals^>
echo\ ^<Principal id="Author"^>
echo\ ^<RunLevel^>LeastPrivilege^</RunLevel^>
echo\ ^<UserId^>S-1-5-18^</UserId^>
echo\ ^</Principal^>
echo\ ^</Principals^>
echo\ ^<Settings^>
echo\ ^<MultipleInstancesPolicy^>IgnoreNew^</MultipleInstancesPolicy^>
echo\ ^<DisallowStartIfOnBatteries^>false^</DisallowStartIfOnBatteries^>
echo\ ^<StopIfGoingOnBatteries^>false^</StopIfGoingOnBatteries^>
echo\ ^<AllowHardTerminate^>true^</AllowHardTerminate^>
echo\ ^<StartWhenAvailable^>false^</StartWhenAvailable^>
echo\ ^<RunOnlyIfNetworkAvailable^>false^</RunOnlyIfNetworkAvailable^>
echo\ ^<IdleSettings^>
echo\ ^<StopOnIdleEnd^>false^</StopOnIdleEnd^>
echo\ ^<RestartOnIdle^>false^</RestartOnIdle^>
echo\ ^</IdleSettings^>
echo\ ^<AllowStartOnDemand^>true^</AllowStartOnDemand^>
echo\ ^<Enabled^>true^</Enabled^>
echo\ ^<Hidden^>false^</Hidden^>
echo\ ^<RunOnlyIfIdle^>false^</RunOnlyIfIdle^>
echo\ ^<WakeToRun^>false^</WakeToRun^>
echo\ ^<ExecutionTimeLimit^>PT20S^</ExecutionTimeLimit^>
echo\ ^<Priority^>7^</Priority^>
echo\ ^</Settings^>
echo\ ^<Actions Context="Author"^>
echo\ ^<Exec^>
echo\ ^<Command^>!throttleDir!\ThrottleStop.exe^</Command^>
echo\ ^</Exec^>
echo\ ^</Actions^>
echo\^</Task^>
) > "!TEMP!\throtleTemp.xml"
echo .
echo . 4- Creating throttleStopOnWakeUp task
echo . triggered on startup and wakeup (when time gets resynched)
echo . task is killed by system after 20 seconds
SCHTASKS /create /tn throttleStopOnWakeUp /f ^
/xml "!TEMP!\throtleTemp.xml" /ru SYSTEM ^
&& echo . * ok Create throttleStopOnWakeUp Task ^
|| echo . *** ERROR creating throttleStopOnWakeUp Task
echo .
rem SCHTASKS /create /tn throttleStopOnWakeUp /f /tr "c:\UT\Info\ThrottleStop.exe" ^
rem /ru SYSTEM /rl highest /delay 0000:15 /sc onlogon
IF "%PARAM:nodel=%"=="%PARAM%" (
echo . 5- deleting temporary "!TEMP!\throtleTemp.xml" file
del "!TEMP!\throtleTemp.xml"
echo .
)
echo .
echo . All Done
echo .
:PAUSEFIN
IF "%PARAM:nopause=%"=="%PARAM%" pause
:FIN
Last edited: