windows - calling batch file that calls yet another batch file fails -
i have batch file a.bat looks this:
call some.bat java -cp "saxon9he.jar" net.sf.saxon.transform abc.xml des.xsl > des.xml call subfolder\other.bat and other.bat in subfolder looks this:
call yet_another_batch.bat java -cp "../saxon9he.jar" net.sf.saxon.transform any.xml try.xsl > try.xml java -cp "../saxon9he.jar" net.sf.saxon.transform ../some.xml test.xsl so in first file (a.bat), call batch file in same folder , xsl scripts in same folder write xml files same folder. first batch script (a.bat) i'd call subfolder\other.bat. however, when that, fails call yet_another_batch.bat in subfolder , xsl scripts in subfolder , doesnt find saxon9he.jar.
what's correct way this? have add folder name files referenced in subfolder\other.bat? seems little cumbersome. i'm on windows 7, if changes anything.
add 2 lines lines other.bat this:
pushd "%~dp0" call yet_another_batch.bat java -cp "../saxon9he.jar" net.sf.saxon.transform any.xml try.xsl > try.xml java -cp "../saxon9he.jar" net.sf.saxon.transform ../some.xml test.xsl popd using pushd, other.bat execute it's commands it's own folder. popd sets directory not changed when return in a.bat
Comments
Post a Comment