dim shell,x,y
x="D:\d"
y="c.bat " & x
set shell=createobject("wscript.shell")
shell.run y
shell.run "a.bat"
set shell=nothing
Run Code Online (Sandbox Code Playgroud)
当我运行此脚本时,它同时运行两个批处理文件。我需要的是它运行第一个批处理文件(c.bat),并且在完全执行后,它应该执行另一个批处理文件(a.bat)。
如果我制作另一个批处理文件并使用,我需要的工作正常:
call c.bat
call a.bat
Run Code Online (Sandbox Code Playgroud)
小智 5
尝试这个:
shell.run y, 1, true
shell.run "a.bat", 1, true
有关详细信息: http://msdn.microsoft.com/en-us/library/d5fk67ky(VS.85) .aspx