maboloshi / Recordum

沙漠之子's 微博客
https://maboloshi.github.io/Recordum
2 stars 0 forks source link

WIN10:手动切换浅色和深色模式 #30

Open maboloshi opened 2 years ago

maboloshi commented 2 years ago

"黑暗模式.vbs"

Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
' 「切换深色 Windows 模式」
objShell.Run "reg.exe add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v SystemUsesLightTheme /t REG_DWORD /d 0 /f", 0
' 「切换深色应用模式」
objShell.Run "reg.exe add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 0 /f", 0
Set objShell = Nothing

"明亮模式.vbs"

Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
' 「切换浅色 Windows 模式」
objShell.Run "reg.exe add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v SystemUsesLightTheme /t REG_DWORD /d 1 /f", 0
' 「切换浅色应用模式」
objShell.Run "reg.exe add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 1 /f", 0
Set objShell = Nothing
maboloshi commented 11 months ago

最新的版本已失效