batch file, saving in a different folder than exe

  • Thread starter Thread starter ZenMasta
  • Start date Start date
Z

ZenMasta

I have a simple batch file that runs a script to convert a file. However I'm
having trouble figuring out how to put the result file in a folder other
then the java folder

cd C:\Program Files\Java\jre1.6.0_03\bin\
java.exe -jar C:\sax\saxon9.jar c:\sax\source\test.xml
c:\sax\switch-onix-tagnames-2.0.xsl
result-document=testymctesterson.xml

This script places the testymctesterson.xml in the bin folder but I want it
to go in c:\sax\export
I've tried putting a dir before the result-document file name but it doesn't
work. The script runs without error and no output file is created.
 
ZenMasta said:
I have a simple batch file that runs a script to convert a file. However
I'm having trouble figuring out how to put the result file in a folder
other then the java folder

cd C:\Program Files\Java\jre1.6.0_03\bin\
java.exe -jar C:\sax\saxon9.jar c:\sax\source\test.xml
c:\sax\switch-onix-tagnames-2.0.xsl
result-document=testymctesterson.xml

This script places the testymctesterson.xml in the bin folder but I want
it to go in c:\sax\export
I've tried putting a dir before the result-document file name but it
doesn't work. The script runs without error and no output file is created.

Try running the program from the target directory:
Line1=@echo off
Line2=cd /d c:\sax\export
Line3="C:\Program Files\Java\jre1.6.0_03\bin\java.exe" -jar
C:\sax\saxon9.jar c:\sax\source\test.xml c:\sax\switch-onix-tagnames-2.0.xsl
result-document=testymctesterson.xml

Alternatively you could copy or move to move testymctesterson.xml
to the desired target directory.
 
Back
Top