Link to home
Start Free TrialLog in
Avatar of Milton Clark
Milton ClarkFlag for United States of America

asked on

A problem with redirect on Windows command line

I'm using CMD under Windows XP to get a command line.  From there, I am issuing a java command with a number of arguments, and trying to redirect the output to a log file.  Problem is (... and I seem to remember something like this many moons ago in my DOS days...) when the command executes, it inserts an additional "1" character before the redirect character ">" and as a result the redirect does not work.

Here's the command in the .BAT file:
  "%JAVA_HOME%\bin\java" -Xms256M -Xmx512M -Duser.language=en -jar ofbiz.jar -install > framework\logs\console.log

.. and here are the results in the cmd window:

C:\>"C:\Program Files\Java\jdk1.5.0_11\bin \java" -Xms256M -Xmx512M -Duser.language=en -jar ofbiz.jar -install  1>framework\logs\console.log

Where is this "1" coming from, and what do I do to avoid it?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Milton Clark

ASKER

I tried the first segment you sent, and I got no output at the command line, so not sure if it worked or not.  (Does the "@" turn echo off?).

The second segment, with the "@" once again stopped any further output to the command line window, so I tried it without "@" and got a similar problem/outcome:  
C:\>("C:\Program Files\Java\jdk1.5.0_11\bin\java" -Xms256M -Xmx512M -Duser.language=en -jar ofbiz.jar -install ) 1>framework\logs\console.log

So, to clarify, I want a way to redirect the output to the logfile, but I also need to see output in the command line window to see what is/is-not executing, and correctly or not.

Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for the info...  Can you point me to a more detailed discussion of redirect under Windows?

Thanks again.
You could really always give out grade of 'A'.

In my opinion the grading system in EE is worthless. To ask a person who knows nothing about the solution other than what you've given them to grade a question that affects the overall points given to the expert is disturbing... At least to me :)

No back to the question:

http://www.robvanderwoude.com/index.html
Thank you on all counts, Steve.