我正在尝试创建一个新文件并覆盖旧文件。简单来说,每次运行我的脚本时都应该覆盖Srv_Disk_Space.html文件。我尝试过ForAppending, False
和ForWriting, True
。两者都没有。
On Error Resume Next
Const ForAppending = 8
Const HARD_DISK = 3
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Open the server list
Set SrvList = objFSO.OpenTextFile("Servers.txt", ForReading)
'Create a result file
Set ReportFile = objFSO.OpenTextFile("Srv_Disk_Space.html", ForAppending, True)