本帖最后由 BEIKING 于 2024-4-5 19:56 编辑
- @echo off
- if /i "%UserName%" == "SYSTEM" (Set PE=1&Goto GotAdmin) else (reg query "HKLM\SYSTEM\ControlSet001\Control\MiniNT" 1>nul 2>nul&&(Set PE=1&Goto GotAdmin))
- :BatchGotAdmin
- Set _Args=%*
- if `%1` neq `` Set "_Args=%_Args:"=""%"
- if exist %WinDir%\System32\fltMC.exe fltMC 1>nul 2>nul||mshta VBScript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c """"%~f0"" %_Args%""",,"runas",1)(Window.Close) 2>nul&&Exit /b
- :GotAdmin
- REM 参数初始化
- Pushd "%CD%"&cd /d "%~dp0"
- Set "BatFile=%~0"&Set "XD=%CD%"
- Set "BatFile=%BatFile:&=^&%"&Set "XD=%XD:&=^&%"
- Set "KillExp=tskill explorer"&Set "HideRun="
- Pecmd /? 1>nul 2>nul&&(Set "KillExp=Pecmd KILL explorer.exe"&Set "HideRun=Pecmd EXEC !")||if exist HideRun.exe Set "HideRun=\"%XD%\HideRun.exe\" "
- if exist Pecmd.exe Set "KillExp=\"%XD%\Pecmd.exe\" KILL explorer.exe"&Set "HideRun=\"%XD%\Pecmd.exe\" EXEC !"
- REM 静默调用参数
- Set Color=%*.
- if /i "%~1" == "install" Call :Menu&Exit /b
- if /i "%~1" == "uninsta" reg delete "HKCR\DesktopBackground\Shell\SetColor" /f 1>nul 2>nul&Exit /b
- :Start
- Title &if exist %WinDir%\System32\ureg.dll Mode 36,6 2>nul
- echo.&echo.&if "%Color:~122,1%" == ":" (echo 设置标题栏颜色为: %Color:~125,-1%&Call :SetColor&Call :Menu) else (
- reg query "HKCR\DesktopBackground\Shell\SetColor" 1>nul 2>nul&&(Color cf&echo 已从桌面右键菜单删除 & reg delete "HKCR\DesktopBackground\Shell\SetColor" /f 1>nul 2>nul)||(Color 9f&echo 已添加到桌面右键菜单&Call :Menu)
- Call :Delay 1
- )
- if /i "%~2" == "KillExplorer" (tskill explorer 1>nul 2>nul||Pecmd KILL explorer.exe 1>nul 2>nul)
- Exit /b
- :Menu
- reg add "HKCU\Control Panel\Desktop" /f /v "AutoColorization" /t REG_DWORD /d 0 1>nul 2>nul
- reg add "HKCU\SOFTWARE\Microsoft\Windows\DWM" /f /v "ColorPrevalence" /t REG_DWORD /d 1 1>nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Windows\DWM" /f /v "ColorPrevalence" /t REG_DWORD /d 1 1>nul 2>nul
- reg delete "HKCR\DesktopBackground\Shell\SetColor" /f 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "SubCommands" /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "MUIVerb" /t REG_SZ /d "设置标题栏颜色(&T)" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "Position" /t REG_SZ /d "Top" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "Icon" /t REG_SZ /d "imageres.dll,-149" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "SeparatorBefore" /t REG_DWORD /d "1" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "SeparatorAfter" /t REG_DWORD /d "1" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00" /f /v "MUIVerb" /t REG_SZ /d "[不生效→重启Explorer]" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00" /f /v "Icon" /t REG_SZ /d "shell32.dll,-47" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00\Command" /f /ve /t REG_SZ /d "%KillExp%" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\01" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\01" /f /v "MUIVerb" /t REG_SZ /d "红色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\01" /f /v "CommandFlags" /t REG_DWORD /d "32" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\01\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF2311E8:C4E81123:FB,9D,8B,00,F4,67,62,00,EF,27,33,00,E8,11,23,00,D2,0E,1E,00,9E,09,12,00,6F,03,06,00,69,79,7E,00:FF1E0ED2:01红色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\02" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\02" /f /v "MUIVerb" /t REG_SZ /d "金色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\02\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF008CFF:C4FF8C00:FF,D1,55,00,FF,B6,34,00,FF,99,10,00,FF,8C,00,00,E3,77,00,00,A1,46,00,00,65,19,00,00,00,63,B1,00:FF0077E3:02金色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\03" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\03" /f /v "MUIVerb" /t REG_SZ /d "黄金色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\03\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF00B9FF:C4FFB900:FF,E8,45,00,FF,D5,2A,00,FF,C2,0D,00,FF,B9,00,00,E1,9D,00,00,9B,5D,00,00,5C,21,00,00,00,B2,94,00:FF009DE1:03黄金色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\04" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\04" /f /v "MUIVerb" /t REG_SZ /d "蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\04\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FFD47800:C40078D4:99,EB,FF,00,4C,C2,FF,00,00,91,F8,00,00,78,D4,00,00,67,C0,00,00,3E,92,00,00,1A,68,00,F7,63,0C,00:FFC06700:04蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\05" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\05" /f /v "MUIVerb" /t REG_SZ /d "深蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\05\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FFB16300:C40063B1:9C,EB,FF,00,40,BD,FF,00,00,7F,DC,00,00,63,B1,00,00,55,A1,00,00,33,7C,00,00,14,5A,00,00,CC,6A,00:FFA15500:05深蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\06" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\06" /f /v "MUIVerb" /t REG_SZ /d "酷蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\06\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF9A7D2D:C42D7D9A:A7,E8,ED,00,6F,C4,D5,00,35,98,B7,00,2D,7D,9A,00,26,6C,88,00,17,45,5F,00,08,21,3A,00,00,CC,6A,00:FF886C26:06酷蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\07" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\07" /f /v "MUIVerb" /t REG_SZ /d "亮酷蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\07\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FFBC9900:C40099BC:7A,F7,FF,00,30,E5,FF,00,00,B8,DF,00,00,99,BC,00,00,85,A6,00,00,55,73,00,00,2A,45,00,E3,00,8C,00:FFA68500:07亮酷蓝色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\08" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\08" /f /v "MUIVerb" /t REG_SZ /d "蓝绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\08\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF878303:C4038387:7C,FB,FC,00,21,F6,FA,00,04,AD,B2,00,03,83,87,00,03,72,76,00,02,4B,4E,00,01,28,2A,00,EF,69,50,00:FF767203:08蓝绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\09" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\09" /f /v "MUIVerb" /t REG_SZ /d "绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\09\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF107C10:C4107C10:95,EF,81,00,45,E5,32,00,19,A1,15,00,10,7C,10,00,0E,6D,0E,00,08,4B,08,00,03,2B,03,00,4C,4A,48,00:FF0E6D0E:09绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\10" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\10" /f /v "MUIVerb" /t REG_SZ /d "艳绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\10\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF647C64:C4647C64:D3,E7,D2,00,A8,BE,A7,00,77,91,77,00,64,7C,64,00,55,6B,55,00,32,43,32,00,12,1E,12,00,D1,34,38,00:FF556B55:10艳绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\11" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\11" /f /v "MUIVerb" /t REG_SZ /d "草绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\11\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF058249:C4498205:C1,F9,6C,00,99,F6,18,00,61,A9,07,00,49,82,05,00,3E,72,04,00,25,4B,03,00,0D,28,01,00,48,68,60,00:FF04723E:11草绿色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\12" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\12" /f /v "MUIVerb" /t REG_SZ /d "深薄荷色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\12\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF748501:C4018574:77,FE,F7,00,1A,FD,E9,00,01,B0,9C,00,01,85,74,00,01,74,63,00,01,4E,3A,00,00,2A,15,00,D1,34,38,00:FF637401:12深薄荷色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\13" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\13" /f /v "MUIVerb" /t REG_SZ /d "沙漠迷彩" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\13\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF457584:C4847545:E9,E5,B0,00,C2,B9,86,00,9D,8D,52,00,84,75,45,00,74,63,3B,00,4E,3B,23,00,2B,15,0C,00,EF,69,50,00:FF3B6374:13沙漠迷彩" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\14" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\14" /f /v "MUIVerb" /t REG_SZ /d "保护色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\14\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF5F737E:C47E735F:E8,E5,CE,00,BF,B8,A3,00,94,89,71,00,7E,73,5F,00,6D,62,51,00,47,3A,30,00,24,15,11,00,00,B7,C3,00:FF51626D:14保护色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\15" /f /ve /t REG_SZ /d "" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\15" /f /v "MUIVerb" /t REG_SZ /d "灰棕色" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\15\Command" /f /ve /t REG_SZ /d "%HideRun%\"%BatFile%\" FF585A5D:C45D5A58:E2,E1,DE,00,AE,AC,AA,00,76,73,70,00,5D,5A,58,00,50,4D,4B,00,30,2D,2C,00,14,10,10,00,FF,43,43,00:FF4B4D50:15灰棕色" 1>nul 2>nul
- if "%Color:~122,1%" neq ":" Goto :eof
- for /f "tokens=2*" %%i in ('reg query "HKCR\DesktopBackground\Shell\SetColor\Shell\%Color:~123,2%" /v "MUIVerb" 2^>nul') do Set "MUIVerb=%%~j"
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\%Color:~123,2%" /f /v "Icon" /t REG_SZ /d "shell32.dll,-44" 1>nul 2>nul
- reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\%Color:~123,2%" /f /v "MUIVerb" /t REG_SZ /d "%MUIVerb% ●" 1>nul 2>nul
- Goto :eof
- :SetColor :: 可能不生效,需要手动重启资源管理器
- if "%PE%" == "1" (Set ROOT=HKEY_LOCAL_MACHINE) else Set ROOT=HKEY_CURRENT_USER
- (echo Windows Registry Editor Version 5.00
- echo [%ROOT%\SOFTWARE\Microsoft\Windows\DWM]
- echo "AccentColor"=dword:%Color:~0,8%
- echo "ColorizationAfterglow"=dword:%Color:~9,8%
- echo "ColorizationColor"=dword:%Color:~9,8%
- echo "ColorPrevalence"=dword:00000001
- echo [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent]
- echo "AccentColorMenu"=dword:%Color:~0,8%
- echo "AccentPalette"=hex:%Color:~18,95%
- echo "StartColorMenu"=dword:%Color:~114,8%) >"%TEMP%\DWM.reg"
- regedit /s "%TEMP%\DWM.reg" 2>nul&del /q "%TEMP%\DWM.reg" 2>nul
- Set n=5
- :Loop :: 可能不生效,需要手动重启资源管理器
- Set /a n-=1
- @start "" rundll32.exe user32.dll,UpdatePerUserSystemParameters 1,True
- if "%n%" neq "0" Goto Loop
- Goto :eof
- :Delay :: 延迟操作 <%1=Sec|延迟秒数> [%2=+|显示倒计时]。
- if "%~2" == "+" (Set #=2) else Set #=1
- if exist %WinDir%\System32\timeout.exe (timeout /t %1 %#%>nul) else if exist %WinDir%\System32\choice.exe (choice /t %1 /d y /n >nul) else ping 127.1 -n %1 >nul
- Goto :eof
复制代码 请用ANSI编码格式保存脚本,UTF-8编码执行会报错。
|