Hi,
Simply put -- batch files are not standalone executables (like Notepad.) You have to
send the file ("document") to its application (command interpreter), CMD.EXE (WinNT)
or Command.com (Win9x). On unix you would use any from the number of shell
interpreters (sh, ksh, etc). Just remember to add appropriate line command switch (/C)
to terminate after script has finished. Check also quirks with environment passing
(eg. PATH)
And BTW -- it's very much non-JSP question ;-/
Best regards,
Piotr
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
On Behalf Of Ritesh_Srivastava
Sent: Wednesday, July 05, 2000 11:21
To: [EMAIL PROTECTED]
Subject: [JSP-INTEREST] Invoking non-console applications using
Runtime.getRuntime().exec ().
Hi,
I am trying to start a standalone Java application from my servlet.
In my servlet, what exactly i am doing is as follows:
On doPost() i am writing:
Process p = Runtime.getRuntime().exec("Batch file");
This batch file is something like this:
java MyApplication
The problem is, this Process cannot execute as it requires console for
processing.Though non-console appl. like notepad can run from the servlet
using exec, but console application are not executed.
I want a way out where i can execute the Batch file or the same command from
my HTML( and not command prompt).
Can anybody help me on this.
Regards,
Ritesh
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets