Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 51959 invoked from network); 30 Jan 2006 20:11:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Jan 2006 20:11:28 -0000 Received: (qmail 85082 invoked by uid 500); 30 Jan 2006 20:11:23 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 84885 invoked by uid 500); 30 Jan 2006 20:11:22 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 84874 invoked by uid 99); 30 Jan 2006 20:11:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 12:11:22 -0800 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 [192.223.198.27] (HELO maillnx-us112.fmr.com) (192.223.198.27) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 12:11:21 -0800 Received: from MSGMROSM01WIN.dmn1.fmr.com (MSGMROSM01WIN.dmn1.fmr.com [172.26.7.127]) by maillnx-us112.fmr.com (Switch-3.1.2/Switch-3.1.0) with SMTP id k0UKAxbA006067 for ; Mon, 30 Jan 2006 15:10:59 -0500 Received: from MSGMROIV02WIN.DMN1.FMR.COM (10.37.74.75) by MSGMROSM01WIN.dmn1.fmr.com (Sigaba Gateway v3.83) with ESMTP id 64265587; Mon, 30 Jan 2006 15:10:59 -0500 Received: from MSGMMKIM02WIN.DMN1.FMR.COM ([172.25.108.84]) by MSGMROIV02WIN.DMN1.FMR.COM with SMTP_server; Mon, 30 Jan 2006 15:10:59 -0500 Received: from msgmmkclp2win.FMR.COM ([10.33.182.29]) by MSGMMKIM02WIN.DMN1.FMR.COM with Microsoft SMTPSVC(5.0.2195.6713); Mon, 30 Jan 2006 15:10:59 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message Subject: RE: Problems with exec task MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Jan 2006 15:10:58 -0500 Message-ID: <51D0EACF8592FA4EAB5D9D83927202FA1C0293@MSGMMKCLP2WIN.DMN1.FMR.COM> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problems with exec task Thread-Index: AcYl06BP+fCjB7/FTpywnllA9MqvbAABPDvw From: "Dick, Brian E." To: "Ant Users List" X-OriginalArrivalTime: 30 Jan 2006 20:10:59.0317 (UTC) FILETIME=[4937EA50:01C625D9] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Actually, wscript.exe is usually associated with Windows scripting languages. I suggested cscript.exe because it is more appropriate for console usage. Wscript.exe displays debug and echo messages in dialog boxes. Cscript.exe displays messages as text. BTW, this is a Windows thing and doesn't have much to do with ant. -----Original Message----- From: Steve Loughran [mailto:stevel@apache.org]=20 Sent: Monday, January 30, 2006 2:30 PM To: Ant Users List Subject: Re: Problems with exec task Rhino wrote: > Thank you both for your suggestions, Clifton and Brian, but I'm afraid > neither one worked! >=20 > When I tried this from my command line: >=20 > cmd.exe start "C:\Documents and Settings\Rhino\My=20 > Documents\LaunchWdMacro.vbs" Fred Flintstone >=20 > All I got was: >=20 > Microsoft Windows XP [Version 5.1.2600] >=20 > The VBScript, which I've changed slightly to make Word visible=20 > (previously, the script said to make Word invisible), did not even bring=20 > up Word, let alone run the Word macro. Yet the VBScript works fine if I=20 > do this on the command line: >=20 > "C:\Documents and Settings\Rhino\My Documents\LaunchWdMacro.vbs" Fred=20 > Flintstone >=20 The command line is special. There is an ENV varialble, PATHEXT which=20 declares which things to start, using ::ShellExecute , which does the=20 mapping from file ext to program, and runs the program with the program=20 passed in. If you add something like .mp3 to PATHEXT, then all you need=20 to do is type in the name of your mp3 file and will autorun in winamp or other chosen player. 1. look up the binding in the registry to find out which app gets run=20 next to .vbs. I dont know what it is, but you need to recreate the=20 command line. 2. I have an exe , "open.exe" that takes any file arg and hands it off=20 to ShellExecute. I can email it to you if you like, though its only=20 about three lines of code, something like #include "shell32.h" void main(char*[] argv) { =20 ::ShellExecute(NULL,"open",argv[1],NULL,::GetCurrentDirectory(),SW_SHOWD EFAULT); } see:=20 http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/shellc= c /platform/shell/reference/functions/shellexecute.asp >=20 > Also, when I tried doing this: >=20 > Documents\LaunchWdMacro.vbs"/> >=20 > >=20 > >=20 > file binding for VBS is, unless changed (I normally bind it to notepad=20 for security reasons): C:\WINDOWS\System32\WScript.exe "%1" %* I wouldnt use the spawn option; all output gets dropped. >=20 >=20 > The exec ran without any error messages but the Word document was=20 > unchanged. Word was not launched and the macro obviously was not run. >=20 > Why won't any of these approaches work, except for the batch file that > runs the VBScript?? >=20 > I've never worked with VBScript before and I've only started working=20 > with Word and Visual Basic for the first time in the last couple of days=20 > so maybe there is some kind of fundamental thing I have not done in=20 > terms of setting up my environment but everything works dandy from the > command line so this feels like an Ant problem, not a Windows problem. >=20 its an shell integration problem, which is something java itself is weak on. There is a limit to what ant can do with the minimal underpinnings,=20 but as a reward we dont have to worry about windows internals, or care=20 about what win vista is going to do with unsigned binaries. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org