Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 54647 invoked from network); 2 Aug 2006 15:48:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2006 15:48:27 -0000 Received: (qmail 61558 invoked by uid 500); 2 Aug 2006 15:48:16 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 61460 invoked by uid 500); 2 Aug 2006 15:48:15 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 61449 invoked by uid 99); 2 Aug 2006 15:48:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 08:48:15 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [82.195.128.118] (HELO postie1.hosting365.ie) (82.195.128.118) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 08:48:14 -0700 Received: from [192.168.1.42] (unknown [83.147.128.36]) by postie1.hosting365.ie (Postfix) with ESMTP id 9EF00CCBEB62 for ; Wed, 2 Aug 2006 16:47:52 +0100 (IST) Message-ID: <44D0C925.90006@so-4pt.net> Date: Wed, 02 Aug 2006 16:47:49 +0100 From: Bart Busschots User-Agent: Thunderbird 1.5.0.5 (Macintosh/20060719) MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: Batch files from JSP References: <19e54ea60608011105hc7733dv6a90dc60281cc56e@mail.gmail.com> <011301c6b621$39a49060$1b01a8c0@THOMAS> <19e54ea60608020842q7a7d743dm504c6e8838533814@mail.gmail.com> In-Reply-To: <19e54ea60608020842q7a7d743dm504c6e8838533814@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N My advice would be to be more specific in the command you shell out with and directly call the perl executable. Something like: Process pr= rt.exec("c:\\Path_to_perl\\perl.exe c:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\sheet\\batch\\db.PL"); Bart. Akshay Ahooja wrote: > Thanks for that... > > I went over that document and a few others on Google...the batch file is > still not working out. > > Instead of a batch file if I try and execute a perl script (.PL) > located on > the host from a remote computer ... > > Process pr= rt.exec("c:\\Program Files\\Apache Software > Foundation\\Tomcat > 5.5\\webapps\\sheet\\batch\\db.PL"); > > I get an error=193 error. Based on research, that error means that it > cannot > find the program with which to open the file. I have set the environment > variables PATH to the perl bin, as well as added .PL in PATHTEXT. > > Any ideas what else I would need? > > Thanks, > > Akshay > > On 8/2/06, Thomas Joseph wrote: >> >> May be you can google "Java runtime exec" >> >> I found this one good. - >> http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html >> >> Hope this can help >> >> Thanks and Regards, >> Thomas Joseph >> >> Kott Software Pvt. Ltd. | Vallamattom Estate | M.G.Road | >> Cochin-682015 | >> India >> www.kottsoftware.com >> >> -------------------------------------------------------------------------------- >> >> This email (including any attachments) is subject to copyright, the >> information in it is confidential, and it is legally privileged. Use >> of this >> email or of any information in it other than by the addressee is >> unauthorized and unlawful. If you are not the intended recipient of the >> mail, kindly intimate the author of the mail and delete the same. >> >> -------------------------------------------------------------------------------- >> >> >> ----- Original Message ----- >> From: Akshay Ahooja >> To: Struts Users Mailing List >> Sent: Tuesday, August 01, 2006 11:35 PM >> Subject: Batch files from JSP >> >> >> Hi, >> >> This is not entirely a struts question, but how would I execute a >> batch >> from >> on the server from a jsp? >> >> If the .bat is in the same file as the jsp calling it. >> >> >> I tried >> >> Runtime rt = Runtime.getRuntime(); >> >> Process pr= rt.exec("db.bat"); >> >> But it gives errors. >> >> java.io.IOException: CreateProcess: db.bat error=2 >> java.lang.ProcessImpl.create(Native Method) >> java.lang.ProcessImpl.(ProcessImpl.java:81) >> java.lang.ProcessImpl.start(ProcessImpl.java:30) >> java.lang.ProcessBuilder.start(ProcessBuilder.java:451) >> java.lang.Runtime.exec(Runtime.java:591) >> java.lang.Runtime.exec(Runtime.java:429) >> java.lang.Runtime.exec(Runtime.java:326) >> org.apache.jsp.batch_jsp._jspService(batch_jsp.java:59) >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> org.apache.jasper.servlet.JspServletWrapper.service( >> JspServletWrapper.java:332) >> >> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) >> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> >> >> Any help would be great, >> >> Thanks, >> >> Akshay >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org