Solved

Write a batch file to update system time

Posted on 2004-04-29
3
1,249 Views
Last Modified: 2013-12-03
Hello,

I am looking for a batch file that will update my system time to the time at time.windows.com I don't really know how to write a batch script, but I do know how to copy and paste the text into a time.bat file. : )


I have been trying things like:
net time /set
net time /setsntp:time.windows.com

Those don't work. PLease help!

Ed

0
Comment
Question by:ekriner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
perlgeek earned 300 total points
ID: 10979926
You almost got it. Try this:
net time /setsntp:time.windows.com /set /y

/set sets the time, /y turns off prompt

For a list of Time servers go to http://www.boulder.nist.gov/timefreq/service/time-servers.html
0
 
LVL 3

Expert Comment

by:MikProg
ID: 10994928
Small addition about "time to time"
It is needed to add several time to .bat

at 9:00 net time /setsntp:time.windows.com
at 12:00 net time /setsntp:time.windows.com
at 15:00 net time /setsntp:time.windows.com
at 18:00 net time /setsntp:time.windows.com

and include this .bat to Autostart folder
0
 

Author Comment

by:ekriner
ID: 11006913
perlgeek,

Thanks for your answer, sorry it took so long to reply, but I have had one of those weeks! Your answer is much appreciated!

Ed
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question