Start a program via VBScript
Posted on 2011-05-04
I'm looking for some advice regarding a VBScript that I have.
Here's the deal:The last two lines of my Vbscript launches a program and passes it a parameter.
And it works great.
And here's what the lines looks like:Set objApp = CreateObject("WScript.Shell")
objApp.Run "cmd /c CD C:\ & ""Program Files\Maze Computer\Manifest Maker\sxs32cmd.exe"" C:\Manifest.sxs32mm"
My problem is:It seems if I add any lines AFTER, obj.App.Run, the application program (Program Files\Maze Computer\Manifest Maker\sxs32cmd.exe ) tells me it’s not being passed the parameter C:\Manifest.sxs32mm.
I have tried enclosing C:\Manifest.sxs32mm in double quotes but, it didn’t have a positive effect.
Right now, in order to get the job done, I have three VBScripts.
A parent script, which calls Child1.Vbs waits 15 seconds and then calls Child2.Vbs.
Child1.Vbs is the script that ends by launching the above application and passes it a parameter.
Child2.Vbs, does “the rest” of the things I need to do after the application, launched by Child1.Vbs has completed.
My goal, is to combine Child1 and Child 2 into the same VBScript.
But, I can't quite figure out why I can’t seem to add lines to the end of the existing Child1.Vbs script.
Any advice would be greatly appreciated.
Thanks in advance.