Jump to content

System Date


DaLiMan
 Share

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)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...