[Asm] 纯文本查看 复制代码 @echo off
setlocal
:: 检查桌面图标当前的显示状态
for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideIcons ^2^>nul') do (
set current_state=%%a
)
:: 如果状态为 1 (隐藏),则改为 0 (显示);否则改为 1 (隐藏)
if "%current_state%"=="0x1" (
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideIcons /t REG_DWORD /d 0 /f
) else (
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideIcons /t REG_DWORD /d 1 /f
)
:: 重启 Explorer 进程以立即生效
taskkill /f /im explorer.exe
start explorer.exe |