Skip to content

Instantly share code, notes, and snippets.

@vuolter
Last active August 29, 2015 14:07
Show Gist options
  • Save vuolter/6f687315b7ed587e4985 to your computer and use it in GitHub Desktop.
Save vuolter/6f687315b7ed587e4985 to your computer and use it in GitHub Desktop.
Fix date time on device with bad cmos battery. Schedule it at system startup. Windows only.
::Date fixup v0.1 by Walter Purcaro <[email protected]>
@ECHO off
SET dummydate=02-10-2014 ::proper date to set
SET failyear=2000 ::wrong year shown on start
IF %date:~6% LEQ %failyear% (
DATE %dummydate%
"%windir%\system32\sc.exe" start w32time task_started
"%windir%\system32\w32tm.exe" /resync
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment