关于VBScript中shell对象的run的问题
'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0
'
' NAME:
'
' AUTHOR: picnic , nuaa
' DATE : 2007-3-22
'
' COMMENT:
'
'==========================================================================
我要获得与脚本在同一个文件夹里的所有程序的路径
然后依次run他们 由于某层文件夹名字中间有空格 所以我把路径用引号chr(34)引起来 想等一个执行完了以后再执行下一个 代码如下:
保存为123.vbs 然后运行的时候提示出错 说“调用子程序时不能使用括号”
错误代码800A0414
出现在我代码中shell.Run(command,1,true)这一行 这个应该怎么解决啊?
Option Explicit
Dim mypath,shell,fso,myself,parent,brothers,oneofbrother,command
mypath = WScript.ScriptFullName
Set shell = WScript.CreateObject("WScript.Shell")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set myself = fso.GetFile(mypath)
Set parent = myself.ParentFolder
set brothers = parent.Files
For Each oneofbrother In brothers
If(oneofbrother.name<>"debug.vbs") Then
command = chr(34)&oneofbrother.path&chr(34)
shell.Run(command,1,true)
End If
Next