|
runfile("d:\a.txt")
function runfile(url)
Dim fso,f
Dim flag
Dim file1,f1
set fso=createobject("scripting.filesystemobject")
flag=fso.fileexists(url) '判断文件存不存在
If flag=false Then
reporter.ReportEvent 0,"文件不存在","succeed"
Set file1=CreateObject("Scripting.FileSystemObject")
Set f1=file1.CreateTextFile("d:\a.txt",true)
reporter.ReportEvent 0,"文件创建成功","succeed"
systemutil.Run "d:\a.txt"
else
set f=fso.getfile(url)
fso.deletefile(url) '删除文件
reporter.ReportEvent 0,"文件删除成功","succeed"
End If
end function
楼主只需将原来的runfile("d:\a.txt")部分替换成systemutil.Run "d:\a.txt"就不会有提示了,如果楼主在创建文件后根本不想打开文件,那么只需去掉红色部分即可sdlkfj2
[ 本帖最后由 hxa2010 于 2007-2-12 09:36 编辑 ] |
|