You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Leon Pu <le...@yahoo.com.cn> on 2005/08/18 18:26:47 UTC

Exec task failed while executing bat which locates in different level directory

Hi all,

the exec task always failed while executing a bat which in a different
level directory compare to basedir.

Here is the sample file system of my build script. The directory
"a/b-1" is the basedir of ant build file build.xml.

[file-system]
a
|-- b-1 (basedir)
|   `-- build.xml
`-- b-2
    |-- c-1
    |   `-- batch.bat
    `-- run.bat
[file-system]

The two bat files' content are same, but only "../b-2/run.bat" executed
successfully. The difference between the two bat file is only the
"a/b-2/c-1/batch.bat" is not in the same level of basedir "a/b-1", the
successful executed run.bat is in the same level "a/b-2" compare to
basdir "a/b-2".

Here are my exec task script and relevant error message.

[exec-successful]
<exec executable="../b-2/run.bat" os="Windows 2000" dir="../b-2">
  <arg line="${foo}" />
</exec>
[exec-successful]

[exec-failure]
<exec executable="../b-2/c-1/batch.bat" os="Windows 2000"
dir="../b-2/c-1">
  <arg line="${foo}" />
</exec>
[exec-failure]
[error-message]
     [exec] Current OS is Windows 2000
     [exec] Executing '..\b-2\c-1\batch.bat' with arguments:
     [exec] 'foo'
     [exec]
     [exec] The ' characters around the executable and arguments are
     [exec] not part of the command.
Execute:Java13CommandLauncher: Executing '..\b-2\c-1\batch.bat' with
arguments:
'foo'

The ' characters around the executable and arguments are
not part of the command.
     [exec] The system cannot find the path specified.
     [exec] Result: 1
[error-message]


Best regards,
Leon


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Exec task failed while executing bat which locates in different level directory

Posted by Leon Pu <le...@yahoo.com.cn>.
Hi all,

I found the problem can be solved by following build script.

<exec executable="cmd" os="Windows 2000" dir="../b-2/c-1">
  <arg line="/c batch.bat" />
  <arg line="${foo}" />
</exec>


Leon

--- Leon Pu <le...@yahoo.com.cn> wrote:

> Hi all,
> 
> the exec task always failed while executing a bat which in a
> different
> level directory compare to basedir.
> 
> Here is the sample file system of my build script. The directory
> "a/b-1" is the basedir of ant build file build.xml.
> 
> [file-system]
> a
> |-- b-1 (basedir)
> |   `-- build.xml
> `-- b-2
>     |-- c-1
>     |   `-- batch.bat
>     `-- run.bat
> [file-system]
> 
> The two bat files' content are same, but only "../b-2/run.bat"
> executed
> successfully. The difference between the two bat file is only the
> "a/b-2/c-1/batch.bat" is not in the same level of basedir "a/b-1",
> the
> successful executed run.bat is in the same level "a/b-2" compare to
> basdir "a/b-2".
> 
> Here are my exec task script and relevant error message.
> 
> [exec-successful]
> <exec executable="../b-2/run.bat" os="Windows 2000" dir="../b-2">
>   <arg line="${foo}" />
> </exec>
> [exec-successful]
> 
> [exec-failure]
> <exec executable="../b-2/c-1/batch.bat" os="Windows 2000"
> dir="../b-2/c-1">
>   <arg line="${foo}" />
> </exec>
> [exec-failure]
> [error-message]
>      [exec] Current OS is Windows 2000
>      [exec] Executing '..\b-2\c-1\batch.bat' with arguments:
>      [exec] 'foo'
>      [exec]
>      [exec] The ' characters around the executable and arguments are
>      [exec] not part of the command.
> Execute:Java13CommandLauncher: Executing '..\b-2\c-1\batch.bat' with
> arguments:
> 'foo'
> 
> The ' characters around the executable and arguments are
> not part of the command.
>      [exec] The system cannot find the path specified.
>      [exec] Result: 1
> [error-message]
> 
> 
> Best regards,
> Leon
> 
> 
> 		
> ____________________________________________________
> Start your day with Yahoo! - make it your home page 
> http://www.yahoo.com/r/hs 
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 



		
__________________________________ 
Yahoo! Mail for Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org