为Win10以上系统桌面增加一键切换主题模式的快捷方式,经测Win10和Win11桌面上均可正常切换。
不用第三方工具也可实现,真正实现无公害。以下是批处理代码:
REG ADD "HKCR\DesktopBackground\Shell\Themes" /V "MuiVerb" /t reg_sz /d "主题切换工具" /F
REG ADD "HKCR\DesktopBackground\Shell\Themes" /V "Icon" /t reg_sz /d "%%SystemRoot%%\System32\display.dll,-1" /F
REG ADD "HKCR\DesktopBackground\Shell\Themes" /V "SubCommands" /t reg_sz /d "" /F
REG ADD "HKCR\DesktopBackground\Shell\Themes\Shell\light" /V "MuiVerb" /t reg_sz /d "切换为明亮主题" /F
REG ADD "HKCR\DesktopBackground\Shell\Themes\Shell\light" /V "Icon" /t reg_sz /d "%%SystemRoot%%\System32\display.dll,-1" /F
REG ADD "HKCR\DesktopBackground\Shell\Themes\Shell\light\Command" /Ve /t reg_expand_sz /d "cmd /c Reg add \"HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\" /V \"SystemUsesLightTheme\" /T REG_DWORD /D "1" /F>NUL&Reg add \"HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\" /V \"AppsUseLightTheme\" /T REG_DWORD /D "1" /F>NUL&&taskkill /F /IM EXPLORER.EXE&&START EXPLORER.EXE" /f
REG ADD "HKCR\DesktopBackground\Shell\Themes\Shell\dark" /V "MuiVerb" /t reg_sz /d "切换为暗黑主题" /F
REG ADD "HKCR\DesktopBackground\Shell\Themes\Shell\dark" /V "Icon" /t reg_sz /d "%%SystemRoot%%\System32\display.dll,-1" /F
REG ADD "HKCR\DesktopBackground\Shell\Themes\Shell\dark\Command" /Ve /t reg_expand_sz /d "cmd /c reg add \"HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\" /V \"SystemUsesLightTheme\" /T REG_DWORD /D "0" /F>NUL&cmd /c Reg add \"HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\" /V \"AppsUseLightTheme\" /T REG_DWORD /D "0" /F>NUL&&taskkill /F /IM EXPLORER.EXE&&START EXPLORER.EXE" /f