我想插入执行脚本的时间和日期。到目前为止,我只有执行脚本的人的用户名....
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
答案 0 :(得分:5)
你可能想要Now语句:
NewTextFile.WriteLine(Now)
或者,如果您不想要时间,请使用日期