Question

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

dim shell  
set shell=createobject("wscript.shell")  
shell.run "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?

Solution

Below

shell.run "a.bat D:\a"

add another line with another

shell.run "b.bat ...."

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

OTHER TIPS

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~"

Wscript.Quit

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