----- Original Message -----
From: "William Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 16, 2001 6:19 PM
Subject: Re: Passing in -D argument with space to the ant.bat script


> 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?

Try:

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

(Taken from "for /?" on W2K, but whould work on NT if I remember correctly)

The ant.bat seems to accept spaces like for example "-Dproperty=Hello, ant"
if the line reading

if "%1"=="" goto doneArgs

is changed to

if X%1 EQU X goto doneArgs

in ant.bat. I can not verify if this will work on non-NT? Can someone else?

Nico


Reply via email to