Appleton Posted March 26, 2008 Share Posted March 26, 2008 I want to be able to update the date and time on a system automatically via a command line or vbscript.Currently I can update the time via a net time command, but this doesnt update the date as well. Is there a way to do this? Link to comment Share on other sites More sharing options...
Appleton Posted April 8, 2008 Author Share Posted April 8, 2008 ? Link to comment Share on other sites More sharing options...
radix Posted April 8, 2008 Share Posted April 8, 2008 (edited) ?Try the next autoit script:Run("rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0")WinWait("Date and Time Properties", "&Time")Send("{TAB 9}")Send("{RIGHT 2}")WinWait("Date and Time Properties", "&Update Now")ControlClick("Date and Time Properties", "&Update Now", "Button2")WinWait("Date and Time Properties", "The time has been successfully synchronized with time.windows.com")ControlClick("Date and Time Properties", "&Update Now", "Button3")If it works, then compile and execute when is needed.Edit: works only for updating time. Edited April 8, 2008 by radix Link to comment Share on other sites More sharing options...
TheReasonIFail Posted April 8, 2008 Share Posted April 8, 2008 The only way to update "date" via command prompt is by using the following:DATE XX/XX/XXXXWere xx/xx/xxxx is the date you want to use.I don't know of any way to update it automatically. Link to comment Share on other sites More sharing options...
Appleton Posted April 9, 2008 Author Share Posted April 9, 2008 Is there a 3rd party app that can pull date/time settings from a server and automatically change the local system date/time? I vaguely remember seeing one before on a thin client but my mind doesn't seem to recall the name of that specific app. Portable would be better so I can run it from a network store. Basically the reason why I am trying to do this is so I can completely have a hands off PXE boot unattended install of Windows XP. This is the last step in the whole process and I cannot seem to get it..... any other workarounds would be appreciated Link to comment Share on other sites More sharing options...
Appleton Posted April 9, 2008 Author Share Posted April 9, 2008 So I finally figured it out on my own. Basically I run 3 commands:net time /setsntp:<servername>net stop w32timenet start w32timeIt's a little more complex than it needs to be but it works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now