Skip to content

Instantly share code, notes, and snippets.

@KillerGoldFisch
Created November 11, 2021 07:58
Show Gist options
  • Save KillerGoldFisch/feafc8998715cccfb170cd44f7e539f1 to your computer and use it in GitHub Desktop.
Save KillerGoldFisch/feafc8998715cccfb170cd44f7e539f1 to your computer and use it in GitHub Desktop.
@ECHO OFF
CLS
ECHO.
ECHO.
ECHO NOTE: This must be run with administrative privileges!
ECHO If you did not right-click on this .bat and select
ECHO "Run as administrator" then exit now and run again
ECHO.
ECHO.
PAUSE
ECHO.
ECHO Setting SNTP server...
sc stop W32Time
TIMEOUT 3
W32tm /config /syncfromflags:manual /manualpeerlist:"time.windows.com"
W32tm /config /reliable:yes
TIMEOUT 2
sc start W32Time
TIMEOUT 3
W32tm /config /update
W32tm /resync
TIMEOUT 2
ECHO.
ECHO. Done!
ECHO.
PAUSE
EXIT
REM Set time source on Windows Server 2008 and later (OK for Domain Controller or Virtual Server)
REM For other NTP servers see: http://www.pool.ntp.org/en/use.html or: http://tf.nist.gov/tf-cgi/servers.cgi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment