you should put single quotes around ${service} if there are multiple words
in the name of the service.

<arg line="net stop '${service}'"/>

d.

-----Original Message-----
From: Antoine Levy-Lambert [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 7:22 AM
To: Ant Users List; Gian Franco Casula
Subject: Re: Stopping and starting a service in Win2000 with Ant.


you should rather do

----- Original Message -----
From: "Gian Franco Casula" <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 12:09 PM


> <property name="service"  value="Netscape Enterprise Server 3.6
(between)"/>
> ...
> <target name="restart" depends="clean"
>  description="Restarts Netscape Enterprise Server" >
>  <exec executable="cmd.exe">
>   <arg line="net stop ${service}"/>
>  </exec>
> </target>
>
should be better
<exec executable="net.exe">
  <arg value="stop"/>
  <arg value="${service}"/>
</exec>
now if ant stalls, it probably means that stdout or stderr do not close
cleanly at the end of the execution of net.exe, or that the command really
hangs.
There are postings on this list about spawning commands.
See in particular this one :
http://marc.theaimsgroup.com/?l=ant-user&m=104322316306620&w=2
Antoine



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

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

Reply via email to