vbscript - how do I execute several programs consecutively in vbs -


i have couple of applications execute 1 following other.

how do this? tried second task never executed.

on error resume next set wshshell = createobject("wscript.shell")   wshshell.run """c:\program files\my folder\do task1.exe.vbs"""  wshshell.run """c:\program files\my folder\do task2.exe.vbs"""  msgbox "finished tasks" 

update: notes found on wshshell.run click here

what missing (per isdi's answer) third parameter of run, tells not wait program quit (false), before continuing code exection.

try (if want put code in subroutine, if coding practice repeat activities):

'place of following in .vbs file  sub runapplication(byval sfile)      dim wshell : set wshell = createobject("wscript.shell")     wshell.run chr(34) & sfile & chr(34), 8, false  end sub   'executing apps.  runapplication "c:\program files\my folder\task1.exe" runapplication "c:\program files\my folder\task2.exe" 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -