Jump to content
Sign in to follow this  
DaLiMan

System Date

Recommended Posts

DaLiMan

I need to change System Date so now and then.

( I bet you all know why... :ph34r: )

Can this be done with Auto-It ???

Share this post


Link to post
Share on other sites
Matt @ MPCS

You could attempt to automate it using the windows clock, or using the DOS command: Date.

*** Matt @ MPCS

Share this post


Link to post
Share on other sites
DaLiMan

DOS [date] sounds interesting!!! :(

Gonna work on that...

Thanx Matt @ MPCS :ph34r:

Share this post


Link to post
Share on other sites
smasher953

I use this to set the date back 1 year for some things that we run. I write the current date to a registry key and then read that registry key to reset the date:

Change date to 1 year ago:

$date = @MON & "/" & @MDAY & "/" & @YEAR
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DateChange", "Date", "REG_SZ", $date)
RunWait(@ComSpec & " /c " & "date " & @MON & "/" & @MDAY & "/" & @YEAR-1, "", @SW_HIDE)

Reset the date back to the current date:

$date = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DateChange", "Date")
RunWait(@ComSpec & " /c " & "date " & $date, "", @SW_HIDE)

Share this post


Link to post
Share on other sites
DaLiMan

Hi smasher953,

Just copied your code to try it, but nothing happens.

The Auto-It icon just remains in the tray.

Could there be something different on my PC?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.