在VBS中的wscript.shell对象下的run指令中.怎么才能使它运行所有符合后缀名的程序?

比如..set wsh=createobject("wscript.shell")..
现在在VBS中我想让wsh.run运行所有只要是.exe的程序...请问怎么实现?..
但是你这个是个无限循环啊....

第1个回答  2009-07-29
'运行当前目录下所有exe,不包括子目录。
dim wsh,fso,f,p
set wsh=createobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
For Each f In fso.GetFolder(".").Files
p = f.Path
If LCase(fso.GetExtensionName(p)) = "exe" Then
wsh.run """" & p & """"
End If
Next

'-------------------------------
'不是无限循环,只是遍历文件本回答被提问者采纳
第2个回答  2009-08-10
for 循环怎么能是无限循环呢?
相似回答