Jump to content
Sign in to follow this  

System Date

Recommended Posts

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...