Win10可一直保持,Win11未测试,可能注册表有变动。
@echo off
setlocal
:: 确保以管理员权限运行
if "%~1" NEQ "runas" (
powershell -Command "Start-Process cmd -ArgumentList '/c %0 runas' -Verb RunAs"
exit /b
)
:: 设置透明注册表参数
echo 注入透明注册表
echo.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAcrylicOpacity /t REG_DWORD /d 0 /f >nul
:: 设置默认Windows模式为深色
echo 设置默认Windows模式为深色
echo.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v SystemUsesLightTheme /t REG_DWORD /d 0 /f >nul
:: 设置默认应用模式为亮色
echo 设置默认应用模式为亮色
echo.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v AppsUseLightTheme /t REG_DWORD /d 1 /f >nul
:: 开启透明效果
echo 开启透明效果
echo.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v EnableTransparency /t REG_DWORD /d 1 /f >nul
:: 检查是否所有命令都成功执行
if %errorlevel% neq 0 (
echo 应用系统颜色设置失败,请检查权限或系统状态。
echo.
pause
exit /b %errorlevel%
)
:: 杀死并重启explorer.exe以使更改生效
echo 正在重启Windows资源管理器...
echo.
taskkill /F /IM explorer.exe >nul 2>&1
start explorer.exe
echo Windows资源管理器已成功重启。
:: 成功时短暂显示成功消息,然后自动关闭窗口
echo.
echo 所有操作已完成,在3秒后自动关闭此窗口...
timeout /t 5 /nobreak >nul
exit
编辑为Bat文件,编码格式为ANSI,运行即可。如需还原,手动更改Windows模式即可。