質問

スクリプトが実行された日時を挿入したいと思います。これまでのところ、スクリプトを実行した人のユーザー名を持っています。...

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
役に立ちましたか?

解決

おそらくNowステートメントが必要です:

NewTextFile.WriteLine(Now)

または、時間が必要ない場合は、日付を使用します

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top