Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1257
  • Last Modified:

Write a batch file to update system time

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
ekriner
Asked:
ekriner
1 Solution
 
perlgeekCommented:
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
 
MikProgCommented:
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
 
ekrinerAuthor Commented:
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now