Syncing time server using batch file-Run as Administrator!

If you make a text file and copy and paste this in *also modifying the part where it asks for your computer name* and then rename it to timesync.bat  ...this will sync your time clock.  I run win 7  and i do have to run it as Administrator otherwise it gives access denied errors.

If this does not work, open a command prompt as administrator and type  w32tm /unregister  then again  w32tm /register    

THEN check and make sure windows time service is in services and on and running. Once that is verified simply run the bat file.

I put a pause at the end so you can see when it runs whether it worked or not. Simply hit any key to close the dos box.

Best of Luck!

Chris

w32tm /config /syncfromflags:manual /manualpeerlist:time.windows.com

w32tm /config /computer:(YOUR COMPUTER NAME) /update

w32tm /resync

pause

Was this discussion helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this discussion?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this discussion?

Thanks for your feedback.

It's OK to experiment on your own, but this batch file contains a number of unnecessary parameters.  In addition,Windows provides a GUI to manage Internet time synchronization.

By default, Windows 7 synchronizes the computer's clock against an Internet time service once/week.  You can select the time server used though a GUI:

  • Click the time display in the Taskbar
  • Click "Change date and time settings
  • Click the "Internet Time" tab
  • Click the "Change settings" button (you may have to respond to a UAC prompt)
  • Make sure the box is checked next to "Synchronize with an Internet time server"
  • Select or enter a time server; by default, this is set to time.Windows.com; there are several nist.gov time servers (see https://tf.nist.gov/tf-cgi/servers.cgi), but often a better choice is pool.ntp.org -- see https://www.ntppool.org/en/

Your computer's clock must be "close" to the correct time or it won't synch. 

-----
LemP
Volunteer Moderator
MS MVP (Windows Desktop Experience) 2006-2009
Microsoft Community Contributor (MCC) 2011-2012

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Discussion Info


Last updated May 17, 2024 Views 13,702 Applies to: