# Simple batch script to sync time with nist server



## nmuleski (Aug 12, 2006)

I have a laptop with a dead CMOS battery that I won't be able to replace for awhile. Until I do I wanted to write a simple batch file to run at log in that would update my time/date for me.
Right now, when I leave it unplugged it resets to factory defaults (jan. '06)

This is what I tried:
@echo off
w32tm /config /sychfromflags:manual /manualpeerlist:time.nist.gov
net stop w32time && net start w32time
w32tm /config /update
w32tm /resync



This won't work even if run manually from the command prompt. I keep getting "Computer did not sync time because time data was not available." after I try the /resync command.

I have opened UDP Port 123 on the Windows Firewall.

I'm running Windows XP Pro SP3, not on a domain.

Any help is appreciated! Thanks!


----------

