FileSystemObject对象 _小例子

2010-11-18  吴楠 

Set fso = Wscript.CreateObject("Scripting.FileSystemObject")    '创建文件系统对象,用以处理驱动器、文件夹和文件
Set WshShell =  Wscript.CreatObject("Wscript.Shell") '创建系统Shell对象,用以运行程序等等。
if fso.fileexists("D:\\刀剑Online\\alreadyexist.txt")  then      '如果找到文件"D:\\刀剑Online\\alreadyexist.txt"则
 WshShell.Run("D:\\刀剑Online\\alreadyexist.exe")            '运行"D:\\刀剑Online\\alreadyexist.exe"
else    
      if fso.fileexists("\\\\gengxin\\update\\dj.exe") then
      WshSell.Run("\\\\gengxin\\update\\dj.exe")
     else
      WshShell.Run("D:\\刀剑Online\\alreadyexist.exe")
      end if
end if
258°/2584 人阅读/0 条评论 发表评论

登录 后发表评论