Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 71411 invoked from network); 2 Dec 2004 16:18:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Dec 2004 16:18:21 -0000 Received: (qmail 39751 invoked by uid 500); 2 Dec 2004 16:16:33 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 39496 invoked by uid 500); 2 Dec 2004 16:16:29 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 39277 invoked by uid 99); 2 Dec 2004 16:16:26 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from claven.sssc.com (HELO SSSC-MAIL-2.internal.sssc.com) (12.34.77.106) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 02 Dec 2004 08:16:25 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Subject: RE: Runtime exec (again) Date: Thu, 2 Dec 2004 09:16:21 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Runtime exec (again) Thread-Index: AcTYTwOonHBGwd8ySly01QEjavn5ugAOtirQ From: "Jim Barrows" To: "Struts Users Mailing List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N If you can get one command to run, and not the other... problem must be = with the way the shutdown is being handled. I don't do windows, however = it may be possible (easy to do under Unix, but with Windows sorry = execuse for a shell scripting language I dunno) to find out what user = the batch command is being run as, and see what king of permissions it = has. Either way it has to do with the shutdown command and the way it's being = run and not the execution of the Java code. > -----Original Message----- > From: andy wix [mailto:stixwix@hotmail.com] > Sent: Thursday, December 02, 2004 2:11 AM > To: user@struts.apache.org > Subject: OT: Runtime exec (again) >=20 >=20 > Hi, >=20 > Still can't get this to work. >=20 > There must be some reason why this won't run under Tomcat but=20 > does work=20 > stand-alone. I have also tried the Tomcat list to no avail. >=20 > To recap, I am trying to execute the following code on an Xp=20 > box with Tomcat=20 > 5.0.27: >=20 > Process proc =3D runtime.exec("cmd.exe /C shutdown -r -f -m=20 \\myPC -t 50"); int exitVal =3D proc.waitFor(); When this runs the proc exits with a value of 0 but nothing happens (no=20 re-boot) and no exceptions are thrown. I have tried running the code from a batch file and without the cmd.exe = /C=20 bit. I have tried running Tomcat from the command line (not as service). I have tried allowing all permissions in the catalina.policy file: grant codeBase "file:${catalina.home}/webapps/ROOT/WEB-INF/classes/-" { permission java.security.AllPermission "*"; }; I CAN successfully set the the system time and date using the same = approach though. I have absolutely no idea on this now. Thanks, Andy _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today!=20 http://www.msn.co.uk/messenger --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org