|
很久以前吾爱上看到的源码,试试这个
@echo off
::VERSION 0.0.1
title=Windows10任务栏透明
:: 修改窗口大小
mode con cols=51 lines=16
:: 备份文件
set RegName=win10任务栏透明修改前备份
reg export "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" %RegName%.reg /y 1>nul 2>nul
echo 已为你本次操作进行了数据备份
echo 如果修改后造成不可逆后果可以尝试通过备份文件恢复
echo 双击reg文件导入恢复数据然后重启计算机
echo 备份文件名称;%RegName%.reg
echo 所在路径;%cd%
echo 正在检测环境...
:: 删除影响任务栏透明的值
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v UseOLEDTaskbarTransparency 1>nul 2>nul
if %errorlevel% == 0 (reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v UseOLEDTaskbarTransparency 1>nul 2>nul)
:: 添加或移除任务栏透明值
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAcrylicOpacity 1>nul 2>nul
:: 如果上面命令执行成功返回结果为0那么证明注册表中已经存在改值
if %errorlevel% == 0 (
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v TaskbarAcrylicOpacity 1>nul 2>nul
echo 任务栏透明已关闭
:: 重启任务资源管理器
taskkill /f /im explorer.exe 1>nul 2>nul & start explorer) else (
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAcrylicOpacity /t REG_DWORD /d 0x00 2>nul
taskkill /f /im explorer.exe 1>nul 2>nul & start explorer
echo 再次运行关闭任务栏透明)
echo 按任意键退出
pause 1>nul 2>nul |
|