开发者

How can a batch file call another batch file?

I have two different batch files at two different path. When I call A.bat from B.bat,开发者_C百科 the batch file that i called(A.bat) doesn't work. When i double click to A.bat it works fine. I think the problem is the path. However, I always use full paths. Why it doesn't work? All i want is to extract my file.

B.batch

call "C:\Documents and Settings\A.bat"

A.batch

SET earfile="E:\bee\deployments\sny1\SnyEarTest.ear"
SET winrar_exe="C:\.....\winrar.exe"
SET war_file="C:\...."

%winrar_exe% e -o+ %earfile% %war_file% 

When i extract my war_file from the path that A.bat exist then my war_file is extracted into path B. Is there any solution to solve my problem?


It should work.

Add pause to the end of B.bat so you can see any error messages before the window closes.

add a cd /d path at the top of B.bat to specify the folder in which the EAR file is decompressed.


Try this in your A.bat:

...
%winrar_exe% e -o+ %earfile% %war_file% "%~dp0"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜