ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Starting and stopping windows services with ANT.
Date Fri, 18 Jun 2004 06:35:38 GMT
You can use <exec> to perform system commands.
With "net start <servicename>" you can start the service and
"net stop <servicename>" will stop that.


Jan



<project>

    <macrodef name="service">
        <attribute name="service"/>
        <attribute name="action"/>
        <sequential>
            <exec executable="cmd.exe">
                <arg line="/c net @{action} '@{service}'"/>
            </exec>
         </sequential>
    </macrodef>

    <target name="start">
        <service action="start" service="Nachrichtendienst"/>
    </target>
    <target name="stop">
        <service action="stop" service="Nachrichtendienst"/>
    </target>


</project>

> -----Original Message-----
> From: Mani G. Iyer [mailto:iyer@rcn.com]
> Sent: Wednesday, June 09, 2004 1:35 AM
> To: 'Ant Users List'
> Subject: RE: Starting and stopping windows services with ANT.
> 
> 
> How about the exec task? 
> 
> mani
> 
> -----Original Message-----
> From: Srikrishna.Partha@wellsfargo.com
> [mailto:Srikrishna.Partha@wellsfargo.com] 
> Sent: Tuesday, June 15, 2004 1:44 PM
> To: user@ant.apache.org
> Subject: Starting and stopping windows services with ANT.
> 
> We have weblogic installed as a windows service. When I am use SC
> command
> everything works . 
> 
>  
> 
>  sc \\eaibigip8 stop EAIWLS_01_IST .
> 
>  
> 
> How to include this in the ant task ?
> 
>  
> 
>  
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message