Hi all, I have a machine running Windows XP that hosts an Apache web server. On this machine, I also have a batch file that invokes Java to run a Java application. I've authored a Perl script to change to the directory that the batch file is in and then to run it. When I double-click on the Perl file, the Java application is run within a command window. This window allows me to see all the output from the application. It also allows me to kill the application by simply closing the window.

Now, I've taken that Perl script and put it in the Apache cgi-bin directory. When I access the script from a web browser, the Java application starts as expected. But, instead of opening a command window, the application output gets printed to the browser. Is there any way to force the Perl script to launch the batch file (and, consequently, the Java application) within a command window on the server machine?

Thanks,

David


In reply to 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.