'完成后写入日志
Dim FileName, FileLog
Dim fs, fso
FileName = CreateObject("Scripting.FileSystemObject").GetFolder(".").Path & "\FileLog.txt"
FileLog = Now() & ": " & ",异常信息:" & Err.Description
Set fs = CreateObject("Scripting.FileSystemObject")
Set fso = fs.OpenTextFile(FileName, 8, True) '第三个参数表明文件不存在,则新建文件
fso.WriteLine FileLog
fso.Close
Set fso = Nothing
Set fs = Nothing
vbs 持续写入数据到文件
最新推荐文章于 2023-05-26 06:57:32 发布