ikegami and ww, thanks for the responses. There is no particularly urgent reason to direct the Java app's output to a command window. The reason I wanted to do it that way is because, before I wrote the Perl script, that is how I have been working with the application. That is, for the most part, I have access to the server machine. To start my Java app, I double-click the batch file. This launches a command window where I can view output and kill the app by simply closing the window. (Your guess that the console output is disposable is correct. Anything of worth is logged using logback.) I've developed the Perl script for the case where I only have remote access to the server machine. In that case, it would be nice if the Java app launched as it normally does, within a command window. That way, if someone else launches the app remotely while I'm at the server machine, I can see the output immediately and also easily kill the Java app if need be.

From the looks of it, this is not an easy problem to solve and it sounds like I'm better off imagining a different setup, e.g. the console output goes to a file and I kill the server with either a batch file or simply by accessing the Task Manager. By the way, can't I just as easily direct the console output to a file like this?

system('run.bat > console.log');

Thanks,

David


In reply to Re^2: CGI script: How to run batch file in command window? by sirstruck
in thread CGI script: How to run batch file in command window? by sirstruck

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.