Win10状态栏透明自动脚本

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模式即可。

lanzou云——懒人直下链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值