Created
May 12, 2022 18:51
-
-
Save MagicalDrizzle/373f65356f6f65fbe6dd0b442520109e to your computer and use it in GitHub Desktop.
small batch scripts to do tedious stuffs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM brightness control in winPE where most of the time there's no brightness bar | |
REM seems to only work on laptops | |
REM mostly copypasted from stackoverflow and I just added some QoL stuffs | |
@echo off | |
set ACDC=DC | |
WMIC /NameSpace:\\root\WMI Path BatteryStatus Get PowerOnline | find /i "true" > nul && set ACDC=AC | |
for /f "tokens=*" %%i in ('powercfg -q ^| find "(Display brightness)"') do set brtnss=%%i | |
set brtnss=%brtnss:~20,36% | |
:BRN | |
powercfg -q SCHEME_CURRENT SUB_VIDEO %brtnss% | find "Current %ACDC%" | |
set /P brightness=Enter % brightness: %=% | |
powercfg -Set%ACDC%ValueIndex SCHEME_CURRENT SUB_VIDEO %brtnss% %brightness% | |
powercfg -S SCHEME_CURRENT | |
goto BRN | |
REM make hoverboard portable https://github.com/AMDmi3/hoverboard-sdl | |
@echo off | |
if exist "%cd%\hoverboard.state" ( | |
mkdir %USERPROFILE%\APPDATA\roaming\hoverboard | |
copy /Y %cd%\hoverboard.state %USERPROFILE%\APPDATA\roaming\hoverboard\ | |
) | |
start "" hoverboard.exe | |
:HOVER | |
tasklist /fi "imagename eq hoverboard.exe" | find ":" > nul | |
if errorlevel 1 ( | |
TIMEOUT /T 10 /NOBREAK | |
goto HOVER | |
) else ( | |
copy /Y %USERPROFILE%\APPDATA\roaming\hoverboard\hoverboard.state %cd%\ | |
) | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment