tags:

views:

879

answers:

1

I'd like to insert the time and date of when the script was executed. So far I just have the username of the person who executed the script....

Set FSO = wscript.CreateObject("Scripting.FileSystemObject")
Set NewTextFile = FSO.OpenTextFile("UserInfo.flag",2,true)
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "User Name = " & WshNetwork.UserName
NewTextFile.WriteLine("Site replication was last executed by user:")
NewTextFile.WriteLine(WshNetwork.userName)
NewTextFile.Close
Set NewTextFile = Nothing
Set FSO = Nothing
+1  A: 

You probably want the Now statement:

NewTextFile.WriteLine(Now)

Or, if you don't want time, use Date

Ch00k