Reputation: 893
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
Upvotes: 2
Views: 22987
Reputation: 10179
You probably want the Now statement:
NewTextFile.WriteLine(Now)
Or, if you don't want time, use Date
Upvotes: 5