Dim fso,operfile
Const foreading = 1, forwriting = 2, forappending = 8
set fso = createobject("scripting.filesystemobject")
if fso.fileexits("d:/ceshi.txt") then
fso.deletefile"d:/ceshi.txt"
else
end if
set openfile = fso.createtextfile("d:/ceshi.txt")
openfile.writeline("写入内容")
openfile.close
本文提供了一个使用VBScript进行文件操作的例子,包括检查文件是否存在、删除文件以及创建并写入文本文件等基本操作。
1万+

被折叠的 条评论
为什么被折叠?



