开发者

how to call more than 1 batch files in a vbscript?

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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜