Sign in to follow this  
Followers 0
Guest SunWuKung

set system date

7 posts in this topic

Sorry - I am sure it is covered somewhere either in the help file or in the forum - I did search for it but I couldn't find the syntax for changing the windows date to a certain date.

Thanks for the help.

SWK

Share this post


Link to post
Share on other sites



You could also try usin the DOS date command.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Thanks for the help.

I think I can do it from here - if not I will post back.

A question out of curiosity: this method with setting the Systime through its dll is a "proper" programmatical approach. I would have thought that the automation approach would be to call the "Adjust Date and Time" window and send keystrokes or set control values - why don't we do that here?

Thx.

SWK

Share this post


Link to post
Share on other sites

A question out of curiosity: this method with setting the Systime through its dll is a "proper" programmatical approach. I would have thought that the automation approach would be to call the "Adjust Date and Time" window and send keystrokes or set control values - why don't we do that here?

Thx.

SWK

<{POST_SNAPBACK}>

Sending keystrokes is a lot slower and will have a higher risk of failure.

Don't see why a programmatic approach with either running the DATE commandline program or calling the DLL won't be the right automation approach.

Automation to me is: "Be lazy, when the script can do the repetitive tasks for me, why would i want to do it manually ..." :whistle:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
RunWait(@ComSpec & " /c DATE " & $DateToSetTo, "", @SW_HIDE) should do the trick without a lot of effort.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0