无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 2616|回复: 31
打印 上一主题 下一主题

[原创] 【适用PE与桌面系统】修改窗口标题栏颜色

  [复制链接]
跳转到指定楼层
1#
发表于 2024-4-5 19:43:07 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 BEIKING 于 2024-4-5 19:56 编辑



  1. @echo off
  2. 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))
  3. :BatchGotAdmin
  4. Set _Args=%*
  5. if `%1` neq `` Set "_Args=%_Args:"=""%"
  6. 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

  7. :GotAdmin
  8. REM 参数初始化
  9. Pushd "%CD%"&cd /d "%~dp0"
  10. Set "BatFile=%~0"&Set "XD=%CD%"
  11. Set "BatFile=%BatFile:&=^&%"&Set "XD=%XD:&=^&%"
  12. Set "KillExp=tskill explorer"&Set "HideRun="
  13. Pecmd /? 1>nul 2>nul&&(Set "KillExp=Pecmd KILL explorer.exe"&Set "HideRun=Pecmd EXEC !")||if exist HideRun.exe Set "HideRun=\"%XD%\HideRun.exe\" "
  14. if exist Pecmd.exe Set "KillExp=\"%XD%\Pecmd.exe\" KILL explorer.exe"&Set "HideRun=\"%XD%\Pecmd.exe\" EXEC !"
  15. REM 静默调用参数
  16. Set Color=%*.
  17. if /i "%~1" == "install" Call :Menu&Exit /b
  18. if /i "%~1" == "uninsta" reg delete "HKCR\DesktopBackground\Shell\SetColor" /f 1>nul 2>nul&Exit /b

  19. :Start
  20. Title &if exist %WinDir%\System32\ureg.dll Mode 36,6 2>nul
  21. echo.&echo.&if "%Color:~122,1%" == ":" (echo      设置标题栏颜色为: %Color:~125,-1%&Call :SetColor&Call :Menu) else (
  22.     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)
  23.     Call :Delay 1
  24. )
  25. if /i "%~2" == "KillExplorer" (tskill explorer 1>nul 2>nul||Pecmd KILL explorer.exe 1>nul 2>nul)
  26. Exit /b

  27. :Menu
  28. reg add "HKCU\Control Panel\Desktop" /f /v "AutoColorization" /t REG_DWORD /d 0 1>nul 2>nul
  29. reg add "HKCU\SOFTWARE\Microsoft\Windows\DWM" /f /v "ColorPrevalence" /t REG_DWORD /d 1 1>nul 2>nul
  30. reg add "HKLM\SOFTWARE\Microsoft\Windows\DWM" /f /v "ColorPrevalence" /t REG_DWORD /d 1 1>nul 2>nul
  31. reg delete "HKCR\DesktopBackground\Shell\SetColor" /f 1>nul 2>nul
  32. reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "SubCommands" /t REG_SZ /d "" 1>nul 2>nul
  33. reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "MUIVerb" /t REG_SZ /d "设置标题栏颜色(&T)" 1>nul 2>nul
  34. reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "Position" /t REG_SZ /d "Top" 1>nul 2>nul
  35. reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "Icon" /t REG_SZ /d "imageres.dll,-149" 1>nul 2>nul
  36. reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "SeparatorBefore" /t REG_DWORD /d "1" 1>nul 2>nul
  37. reg add "HKCR\DesktopBackground\Shell\SetColor" /f /v "SeparatorAfter" /t REG_DWORD /d "1" 1>nul 2>nul
  38. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  39. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00" /f /v "MUIVerb" /t REG_SZ /d "[不生效→重启Explorer]" 1>nul 2>nul
  40. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00" /f /v "Icon" /t REG_SZ /d "shell32.dll,-47" 1>nul 2>nul
  41. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\00\Command" /f /ve /t REG_SZ /d "%KillExp%" 1>nul 2>nul
  42. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\01" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  43. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\01" /f /v "MUIVerb" /t REG_SZ /d "红色" 1>nul 2>nul
  44. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\01" /f /v "CommandFlags" /t REG_DWORD /d "32" 1>nul 2>nul
  45. 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
  46. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\02" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  47. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\02" /f /v "MUIVerb" /t REG_SZ /d "金色" 1>nul 2>nul
  48. 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
  49. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\03" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  50. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\03" /f /v "MUIVerb" /t REG_SZ /d "黄金色" 1>nul 2>nul
  51. 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
  52. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\04" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  53. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\04" /f /v "MUIVerb" /t REG_SZ /d "蓝色" 1>nul 2>nul
  54. 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
  55. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\05" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  56. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\05" /f /v "MUIVerb" /t REG_SZ /d "深蓝色" 1>nul 2>nul
  57. 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
  58. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\06" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  59. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\06" /f /v "MUIVerb" /t REG_SZ /d "酷蓝色" 1>nul 2>nul
  60. 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
  61. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\07" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  62. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\07" /f /v "MUIVerb" /t REG_SZ /d "亮酷蓝色" 1>nul 2>nul
  63. 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
  64. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\08" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  65. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\08" /f /v "MUIVerb" /t REG_SZ /d "蓝绿色" 1>nul 2>nul
  66. 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
  67. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\09" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  68. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\09" /f /v "MUIVerb" /t REG_SZ /d "绿色" 1>nul 2>nul
  69. 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
  70. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\10" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  71. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\10" /f /v "MUIVerb" /t REG_SZ /d "艳绿色" 1>nul 2>nul
  72. 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
  73. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\11" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  74. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\11" /f /v "MUIVerb" /t REG_SZ /d "草绿色" 1>nul 2>nul
  75. 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
  76. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\12" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  77. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\12" /f /v "MUIVerb" /t REG_SZ /d "深薄荷色" 1>nul 2>nul
  78. 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
  79. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\13" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  80. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\13" /f /v "MUIVerb" /t REG_SZ /d "沙漠迷彩" 1>nul 2>nul
  81. 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
  82. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\14" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  83. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\14" /f /v "MUIVerb" /t REG_SZ /d "保护色" 1>nul 2>nul
  84. 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
  85. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\15" /f /ve /t REG_SZ /d "" 1>nul 2>nul
  86. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\15" /f /v "MUIVerb" /t REG_SZ /d "灰棕色" 1>nul 2>nul
  87. 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
  88. if "%Color:~122,1%" neq ":" Goto :eof
  89. for /f "tokens=2*" %%i in ('reg query "HKCR\DesktopBackground\Shell\SetColor\Shell\%Color:~123,2%" /v "MUIVerb" 2^>nul') do Set "MUIVerb=%%~j"
  90. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\%Color:~123,2%" /f /v "Icon" /t REG_SZ /d "shell32.dll,-44" 1>nul 2>nul
  91. reg add "HKCR\DesktopBackground\Shell\SetColor\Shell\%Color:~123,2%" /f /v "MUIVerb" /t REG_SZ /d "%MUIVerb%  ●" 1>nul 2>nul
  92. Goto :eof

  93. :SetColor :: 可能不生效,需要手动重启资源管理器
  94. if "%PE%" == "1" (Set ROOT=HKEY_LOCAL_MACHINE) else Set ROOT=HKEY_CURRENT_USER
  95. (echo Windows Registry Editor Version 5.00
  96. echo [%ROOT%\SOFTWARE\Microsoft\Windows\DWM]
  97. echo "AccentColor"=dword:%Color:~0,8%
  98. echo "ColorizationAfterglow"=dword:%Color:~9,8%
  99. echo "ColorizationColor"=dword:%Color:~9,8%
  100. echo "ColorPrevalence"=dword:00000001
  101. echo [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent]
  102. echo "AccentColorMenu"=dword:%Color:~0,8%
  103. echo "AccentPalette"=hex:%Color:~18,95%
  104. echo "StartColorMenu"=dword:%Color:~114,8%) >"%TEMP%\DWM.reg"
  105. regedit /s "%TEMP%\DWM.reg" 2>nul&del /q "%TEMP%\DWM.reg" 2>nul
  106. Set n=5
  107. :Loop :: 可能不生效,需要手动重启资源管理器
  108. Set /a n-=1
  109. @start "" rundll32.exe user32.dll,UpdatePerUserSystemParameters 1,True
  110. if "%n%" neq "0" Goto Loop
  111. Goto :eof

  112. :Delay :: 延迟操作 <%1=Sec|延迟秒数> [%2=+|显示倒计时]。
  113. if "%~2" == "+" (Set #=2) else Set #=1
  114. 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
  115. Goto :eof
复制代码

复制代码
请用ANSI编码格式保存脚本,UTF-8编码执行会报错。

点评

哈哈…确实简单易用。大佬能不能再出个修改非活动窗口标题栏颜色的bat文件?  发表于 2024-9-2 12:33
精品  发表于 2024-4-5 20:02
辛苦了  发表于 2024-4-5 19:46

评分

参与人数 3无忧币 +12 收起 理由
三北豆酥糖 + 5 赞一个!
huyadong + 5 很给力!
yyz2191958 + 2 赞一个!

查看全部评分

2#
发表于 2024-4-5 19:45:32 | 只看该作者
回复

使用道具 举报

3#
发表于 2024-4-5 19:45:46 | 只看该作者
支持原创
回复

使用道具 举报

4#
 楼主| 发表于 2024-4-5 19:54:14 | 只看该作者
刚脚本粘贴,被转义有问题,以此时间点更新为准
回复

使用道具 举报

5#
发表于 2024-4-5 19:54:40 | 只看该作者
大师你可以搞个软件把窗口aero边框搞出来吗?win7那种
回复

使用道具 举报

6#
发表于 2024-4-5 20:18:24 | 只看该作者
感谢分享
回复

使用道具 举报

7#
发表于 2024-4-5 20:32:08 | 只看该作者
感谢分享
回复

使用道具 举报

8#
发表于 2024-4-5 20:48:14 | 只看该作者
感谢分享
回复

使用道具 举报

9#
发表于 2024-4-5 20:55:35 | 只看该作者
那pe原生设置成什么颜色靠什么,特别是有 那个s开头美化软件的pe
回复

使用道具 举报

10#
发表于 2024-4-5 21:15:50 | 只看该作者
谢谢分享,11PE测试有效
回复

使用道具 举报

11#
发表于 2024-4-5 23:59:55 来自手机 | 只看该作者
这个行,十分感谢分享!
回复

使用道具 举报

12#
发表于 2024-4-6 00:05:32 | 只看该作者
谢谢分享
回复

使用道具 举报

13#
发表于 2024-4-6 04:43:57 | 只看该作者
谢谢分享
回复

使用道具 举报

14#
发表于 2024-4-6 06:52:19 | 只看该作者
谢谢分享
回复

使用道具 举报

15#
发表于 2024-4-6 07:29:36 | 只看该作者
感谢楼主分享
回复

使用道具 举报

16#
发表于 2024-4-6 08:06:52 | 只看该作者
还可以,不能移动位置,执行的BAT,移动要重新执行
回复

使用道具 举报

17#
发表于 2024-4-6 09:56:30 | 只看该作者
感谢分享
感谢分享
回复

使用道具 举报

18#
发表于 2024-4-6 11:01:58 | 只看该作者
弄下来试试
回复

使用道具 举报

19#
发表于 2024-4-6 13:46:57 来自手机 | 只看该作者
感谢分享
回复

使用道具 举报

20#
发表于 2024-4-6 16:13:01 | 只看该作者
谢谢分享
回复

使用道具 举报

21#
发表于 2024-5-6 19:27:39 | 只看该作者
谢谢分享
回复

使用道具 举报

22#
发表于 2024-5-6 19:37:12 | 只看该作者
学习
回复

使用道具 举报

23#
发表于 2024-5-18 22:11:33 | 只看该作者
感谢大佬好东西
回复

使用道具 举报

24#
发表于 2024-5-18 22:26:23 | 只看该作者
新系统里面自带这个功能

回复

使用道具 举报

25#
发表于 2024-8-31 13:19:28 | 只看该作者
感谢分享
回复

使用道具 举报

26#
发表于 2024-10-1 19:41:34 | 只看该作者
谢谢分享!
回复

使用道具 举报

27#
发表于 2024-10-2 11:30:29 | 只看该作者
WIN11 PE 测试无效
回复

使用道具 举报

28#
发表于 2024-10-2 12:54:07 | 只看该作者
这个行,十分感谢分享!
回复

使用道具 举报

29#
发表于 2024-10-18 08:21:18 | 只看该作者
谢谢分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-11-30 18:44

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表