Update Windows clock by syncing with NTP servers - the built-in sync simply doesn't work on my computer.
Built after frustration with Windows' sync repeatedly failing. This tool actually works.
- Uses multiple NTP servers (Google, Windows, NIST)
- Shows time difference
- Auto-updates system time
- Admin privileges handled via batch file
- Windows OS
- Python 3.x
- Administrator privileges (for setting the system time)
- Right-click on
run_sync_admin.batand select "Run as administrator" - The script will automatically:
- Connect to available NTP servers
- Display the time difference
- Update your system time
That's it! Your system clock is now accurate.
To automatically sync your clock every time Windows starts:
- Press
Win + Rto open the Run dialog - Type
shell:startupand press Enter - Create a shortcut to
run_sync_admin.batin this folder- Right-click in the Startup folder → New → Shortcut
- Browse to the location of
run_sync_admin.batand select it - Click Next and Finish
Alternatively, you can set up a scheduled task:
- Open Task Scheduler (search for it in the Start menu)
- Create a Basic Task
- Set trigger to "When I log on"
- Action: Start a program
- Program/script: Select the full path to
run_sync_admin.bat - Select "Run with highest privileges"
The script connects to NTP servers using the UDP protocol, retrieves the current accurate time, and uses Windows commands to update your system clock. All operations require administrator privileges since changing system time is a protected operation.
Feel free to use, modify, and distribute this code however you like!
Found a bug or want to improve something? Pull requests are welcome!