Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM reading current profile from regisrty
- FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Gigabyte\AppCenter\ApInfo\RGBFusion" /v "Profile"') DO set "currentState=%%B"
- set currentState=%currentState:~2,1%
- REM set your profiles numbers here
- set prDay=3
- set prDusk=2
- set prNight=1
- set prSpecial=4
- set prGame=5
- set prSet=%prDay%
- REM check if specific app/game is running. If yes then ommit all other checks.
- tasklist /FI "IMAGENAME eq X-Plane.exe" 2>NUL | find /I /N "X-Plane.exe">NUL
- IF "%ERRORLEVEL%"=="0" (
- set prSet=%prGame%
- goto LetThereBeLight
- )
- REM checking time
- SET hour=%time:~0,2%
- SET minute=%time:~3,2%
- REM getting day of week
- for /f %%a in ('wmic path win32_localtime get dayofweek /format:list ^| findstr "="') do (set %%a)
- REM conditions for profiles
- REM set dusk profile between 17:00 and 19:59
- IF %hour% GEQ 17 IF %hour% LSS 20 ( SET prSet=%prDusk% )
- REM set night profile between 20:00 and 6:59
- IF %hour% GEQ 20 ( SET prSet=%prNight% )
- IF %hour% LSS 7 ( SET prUstaw=%prNight% )
- REM set special profile between 20:00 and 5:59 on weekend nights
- IF %dayofweek% GEQ 5 IF %hour% GEQ 20 ( SET prSet=%prSpecjalny% )
- :LetThereBeLight
- REM checking if profile change is needed
- IF %currentState%==%prSet% ( GOTO :TheEnd )
- REM setting profile in registry then running app
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Gigabyte\AppCenter\ApInfo\RGBFusion" /v Profile /t REG_DWORD /d %prSet% /f
- START /B C:\"Program Files (x86)"\GIGABYTE\RGBFusion\RunLed.exe
- REM try to kill app
- timeout 2
- taskkill /f /im RGBFusion.exe
- :TheEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement