开发者

How to invoke a windows batch file from another batch file

I need to create a batch file that changes path to a particular folder and executes a set of another bat files.

My batch file looks as follows:

start cd c:\temp\
command1
command2

But it does not开发者_如何学运维 work. It just changes path to C:\Temp but ignores next lines.

How can I fix this?

Thank you.


Try:

cd c:\temp
start command1 
start command2


Put "call" in front of references to other .bat files. Like this,

cd c:\temp
call command1 
call command2


dont forget to check if you are really on drive c. try executing a "c:" first before anything else.

c:
cd c:\temp\


Just put CD c:\temp:

cd c:\temp\
command1
command2

Or even:

cd c:\temp\
start /W command1
start /W command2


cd c:\temp
cmd /c command1 
start command2


If you take out the start command, it should work.

cd c:\temp\
command1
command2
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜