如何在VBScript中覆盖文件

时间:2017-06-06 12:59:13

标签: vbscript

我正在尝试创建一个新文件并覆盖旧文件。简单来说,每次运行我的脚本时都应该覆盖Srv_Disk_Space.html文件。我尝试过ForAppending, FalseForWriting, 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)

0 个答案:

没有答案