batch file, saving in a different folder than exe

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.
 
P

Pegasus \(MVP\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top