I am using the following code to call a batch file:

dim shell  
set shell=createobject("") "a.bat D:\a"  
set shell=nothing    

How do I call more than 1 batch file, so that when the 1st file's execution is over the 2nd file is executed. as always, I really appreciate any help offered.

Was it helpful?


Below "a.bat D:\a"

add another line with another "b.bat ...."

Or create a batch file that calls all the other batch files, and call that batch file from your script.


Option explicit

Dim oShell

set oShell = Wscript.CreateObject("WScript.Shell")

oShell.Run "RunAs /noprofile /user:Admininistrator ""%comspec% /c 1stcommand && 2ndcommand && 3rdcommand""", 1, false

WScript.Sleep 1000

oShell.Sendkeys "AdmininistratorPassword~"


Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top