電腦的時間同步的電池沒電了,每天開機時間都不對,要打開時間同步按鈕來設置時間
解決方案
1.找到這個設置并打開,實際上,要打開這個界面,時間才會同步,可能是我的電腦原因,所以我沒辦法打開這個就結束了
?2.寫一個bat腳本,后綴為.bat就可以了
@echo off
title Network Time Sync Tool
color 0Aecho =========================================
echo Network Time Sync Tool
echo =========================================
echo.
echo This tool will help you sync network time through Windows settings
echo.
echo Preparing...
echo.:: Check for administrator privileges
net session >nul 2>&1
if %errorLevel% equ 0 (echo Administrator privileges detected, attempting automatic time sync...echo.w32tm /resync /forceif %errorLevel% equ 0 (echo =========================================echo Time synchronization successful!echo.echo Current system time: %date% %time%echo =========================================echo.echo Your system time has been successfully synced with network time.pauseexit /b) else (echo Automatic sync failed, will open time settings interface...)
)echo =========================================
echo Please follow these steps to sync time manually:
echo 1. Select the "Sync" button in the popup window
echo 2. The window will close automatically after 3 seconds
echo =========================================
echo.:: Open Windows time settings
start ms-settings:dateandtimeecho Time settings window has opened, please complete the synchronization.
echo Window will close automatically in 3 seconds...
echo.:: Wait for 3 seconds
timeout /t 3 /nobreak >nul:: Close the time settings window
taskkill /f /im SystemSettings.exe >nul 2>&1
3.把bat文件放到啟動文件夾里面
看我的路徑,找不到的就win+r,然后輸入下面的指令
shell:Common Startup