脚本库\任务栏时钟切换显示秒.bat 编码: UTF-8
25 656 728 B
返回
@echo off
chcp 65001 >nul

reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSecondsInSystemClock >nul 2>&1
if %errorlevel%==0 (
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSecondsInSystemClock /f
    echo.
    echo 已关闭任务栏时钟秒数显示
) else (
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSecondsInSystemClock /t REG_DWORD /d 1 /f
    echo.
    echo 已开启任务栏时钟秒数显示
)

echo.
echo 正在重启资源管理器...
taskkill /f /im explorer.exe
timeout /t 2 /nobreak >nul
start explorer.exe

echo.
echo 完成!

timeout /t 2 /nobreak >nul
exit /b 0