Skip to content

Instantly share code, notes, and snippets.

@hui-shao
Created April 8, 2023 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hui-shao/25f049a78483df6041c79e05dac9837a to your computer and use it in GitHub Desktop.
Save hui-shao/25f049a78483df6041c79e05dac9837a to your computer and use it in GitHub Desktop.
Windows Time Sync
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
net start w32time
w32tm /config /manualpeerlist:"ntp.ntsc.ac.cn,0x1 cn.ntp.org.cn,0x2 time.pool.aliyun.com,0x3 cn.pool.ntp.org,0x4 time.windows.com,0x5" /syncfromflags:manual /update
w32tm /resync /rediscover
net stop w32time
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment