【发布时间】:2012-12-17 04:04:46
【问题描述】:
我有 4 个 .vbs 文件,例如 A.VbS、B.VBS、C.VBS、D.VBS。我想按以下顺序称呼他们:
(1)A.VBS
(2)B.VBS
(3)C.VBS
(4)D.VBS
当第一个完成后,第二个应该会自动启动,依此类推。
你能帮我完成这些任务吗?
编辑:
Option Explicit
Dim oShell : Set oShell = WScript.CreateObject ("WScript.Shell")
Dim FSO : set FSO = CreateObject("Scripting.FileSystemObject")
Dim Path
REM oShell.run "ParentChildLinkFinal.vbs", 1, True
REM oShell.run "Parent_Child_Merge_final.vbs", 1, True
REM oShell.run "Baddata.vbs", 1, True
REM oShell.run "CycleTime.vbs", 1, True
msgBox(oShell.CurrentDirectory)
MsgBox(FSO.GetFile(Wscript.ScriptFullName).ParentFolder )
Path=FSO.GetFile(Wscript.ScriptFullName).ParentFolder
oShell.run Path\ParentChildLinkFinal.vbs, 1, True
oShell.run Path\Parent_Child_Merge_final.vbs, 1, True
oShell.run Path\Baddata.vbs, 1, True
oShell.run Path\CycleTime.vbs, 1, True
我收到以下错误:
变量未定义:“arentChildLinkFinal.vbs”
有什么办法解决这个问题?
【问题讨论】:
-
对于您编辑的部分,您需要在名称周围加上引号,例如“Path\ParentChildLinkFinal.vbs”。抱歉,我看到路径是一个变量。使用第二个示例检查我更新的答案,然后您不需要包含路径,它可以只是“ParentChildLinkFinal.vbs”。
-
@PeterJ 你今天为我提供了很好的概念!!我刚刚给了你
+1。而且我认为我的帖子也得到了更多+1以将此类研究带入StackOverflow
标签: vbscript