Solved

Write a batch file to update system time

Posted on 2004-04-29
3
1,247 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…

861 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