Skip to content

Instantly share code, notes, and snippets.

@toml01
Last active April 19, 2020 13:38
Show Gist options
  • Save toml01/1110ae5a6dfed1409ee820b80e6cec1b to your computer and use it in GitHub Desktop.
Save toml01/1110ae5a6dfed1409ee820b80e6cec1b to your computer and use it in GitHub Desktop.
Automatic clock sync
REM For this to work, you need to run it as admin
REM Create a shortcut of this file, go to Properties -> Shourcut -> Advanced -> Run as admin
REM Point the .vbs file to the shortcut
w32tm /resync
'Put this file at %AppData%\Microsoft\Windows\Start Menu\Programs\Startup for it to run at startup
Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run "C:\dev\clock_sync.bat.lnk", 0 'Must quote command if it has spaces; must escape quotes
Set WshShell = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment