Sign in to follow this  
Followers 0
mulletmandan

Temporary Date Change

4 posts in this topic

I'm trying to set up a script to change the system date temporarily and then change it back. Here's what I've got:

$currentdate=@Mon & "/" & @MDay & "/" & @Year
MsgBox(4096,"Notify", $currentdate)
Run(@ComSpec & " /c " & 'date 11/11/2003', "", @SW_HIDE)
MsgBox(4096,"Notify", "Date Changed")
Run(@ComSpec & " /c " & 'date $currentdate', "", @SW_HIDE)
MsgBox(4096,"Notify", "Date Changed Back")
Exit

The date will change, but won't change back. I am guessing this has something to do with my variable in Line 5. Any help would be nice.

Thanks!

Share this post


Link to post
Share on other sites



try:

Run(@ComSpec & " /c " & 'date ' & $currentdate, "", @SW_HIDE)

also IMO it would be better if you use runwait.

<{POST_SNAPBACK}>

Sorry, I'm a bit new at this. Could you rewrite that script for me using runwait so I can see its usage?

Thanks!

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