Gossamer Forum
Home : General : Internet Technologies :

Set date script

Quote Reply
Set date script
Can anyone please telle me how to make a simple script that sets the system date.

When I run the script below I get an error that the assignment is invalid



Dim Dato

Dato = date
MsgBox Dato
Date = Dato
Quote Reply
Re: [KennyG] Set date script In reply to
"Sets" meaning assign the date to a variable or actually set the system date?

What language?

That code looks like VB or VBScript?
Quote Reply
Re: [Paul] Set date script In reply to
It is a VB script

And what I want is to change the system date.
Quote Reply
Re: [KennyG] Set date script In reply to
Code is:

Code:
Private Sub Command1_Click()
DateTime.Date = "August 1 2000"
End Sub

Example project attached.
Quote Reply
Re: [Paul] Set date script In reply to
Thanks for trying but it still dont work.

The script is a host script.

Just save the lines in a file with the extension .vbs

and run it.
Quote Reply
Re: [KennyG] Set date script In reply to
So it's vbscript and not vb :)

In that case I'm not certain on how to do it. I think it will probably involve the DateTime object still but the syntax will be different.