Solved

Write a batch file to update system time

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

628 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