ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Lee <>
Subject Re: Passing in -D argument with space to the ant.bat script
Date Tue, 16 Jan 2001 17:19:03 GMT
Doing ant "-DPROP=dir with space" would yield the same error... BTW, if
anyone knows how to get the short name (with the ~) for the current
directory and can assign it to a variable I'd be grateful.  It's
somewhat unrelated to ant, but it's nice to have this working with ant
script so we can all pass in path name as argument.  The dir /x would
list the name fine but here is what I'm doing:

for /F "eol=; delims=," %%f in ('cd') do (
	set TARGET_DIR=%%f



'cd' would yield the full path name.  What I did here is to assign the
current directory to the TARGET_DIR variable and pass it to the ant
script.  This works perfectly fine if the directory doesn't have space
in it.  Does anyone know how I can convert the long name to short name?


Nico Seessle wrote:
> ----- Original Message -----
> From: "William Lee" <>
> To: "Ant User" <>
> Sent: Tuesday, January 16, 2001 5:16 AM
> Subject: Passing in -D argument with space to the ant.bat script
> > The "ant.bat" script that comes with Ant 1.2 doesn't seem to support -D
> > options with space in it.  For example, I can do:
> >
> > c:\> ant -DPROP="dir with space"
> >
> > I'll get:
> >
> > with was unexpected at this time.
> >
> Can you try out
> c:\> ant "-DPROP=dir with space"?
> Looks funny, but may work better...
> Nico

View raw message