Rhino wrote:
Hurrah! Problem solved!

That did it, Tommy!

Here's the revised property and exec which now works fine:

<property name="vbs.script" value="'c:\Documents and Settings\Rhino\My Documents\LaunchWdMacro.vbs'"/>

<exec executable="cscript.exe" spawn="true">

<arg line="${vbs.script} Dudley Doright"/>

</exec>

Therefore, the executable needs to be 'cscript.exe' and the path name needs to be within single quotes if it contains embedded blanks.

Many thanks to all who gave suggestions, particularly Tommy for the one about putting the path within single quotes and Brian for the one about using cscript.exe instead of cmd.exe.

I'm not surprised that the Ant manual doesn't mention that you need to use cscript.exe to run a VBScript since that's relatively obscure; how many people who want to use exec want it to run a VBScript?

Does the Ant manual mention that you can handle embedded blanks in a path with a pair of single quotes? I don't recall ever seeing that mentioned but the manual isn't searchable so I can't just search for all occurrences of "embedded blanks" to verify that. Perhaps it is in the manual somewhere but I just missed it. If that fact isn't in the manual somewhere, it certainly ought to be, in my opinion. Many many Ant users stand a good chance of encountering that problem at some point so the single quote technique really needs to be in the manual.

Well, there is the bit that says

"It is highly recommended to avoid the line version when possible. Ant will try to split the command line in a way similar to what a (Unix) shell would do, but may create something that is very different from what you expect under some circumstances."

If you go

<arg value="${vbs.script}"/>
<arg value="Dudley"/>
<arg value="Doright"/>

you get exactly what you need, no surprises.




If it _is_ in the manual, could someone tell me where it is? If it _isn't_ in the manual, what is the appropriate way of asking the Ant developers to add it to the manual?


You add it to the manual in your local copy, and submit the patch. We welcome extra details and examples on things like exec


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to