A.vbS, B.VBS, C.VBS, D.VBS 등 4 개의 .vbs 파일이 있습니다. 다음과 같은 순서로 호출하고 싶습니다..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
나는 다음과 같은 오류 얻을 :
Variable is undefined : "arentChildLinkFinal.vbs"
이에 대한 수정은 무엇입니까?
Dim oShell : Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "A.VBS", 1, True
oShell.run "B.VBS", 1, True
oShell.run "C.VBS", 1, True
oShell.run "D.VBS", 1, True
당신은 또한 할 수있는 대안으로 : 다른 VBS에서 실행하려면 가정
편집 된 파트의 경우 "Path \ ParentChildLinkFinal.vbs"와 같이 이름을 따옴표로 묶어야합니다. 죄송합니다. 경로가 변수라는 것을 알았습니다. 두 번째 예제를 사용하여 업데이트 된 답변을 확인하면 경로를 포함 할 필요가 없으며 단지 "ParentChildLinkFinal.vbs"일 수 있습니다. – PeterJ
@ PeterJ 당신이 나에게 오늘 제공 한 탁월한 컨셉! 방금 당신에게'+ 1'을주었습니다. 그리고 내 글은'StackOverflow'에서 그런 연구를하기 위해'+ 1'을 좀 더 얻을 것으로 생각합니다. –