March 26, 200818 yr 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?
April 8, 200818 yr ?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, 200818 yr by radix
April 8, 200818 yr 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.
April 9, 200818 yr Author 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
April 9, 200818 yr Author 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.
Create an account or sign in to comment