You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by hezjing <he...@gmail.com> on 2008/01/09 17:07:15 UTC

Ant to start and stop Windows service

Hi

In Windows command window, I used the following command to start and
stop MySQL service

> net start mysql
The MySQL service was started successfully.

> net stop mysql
The MySQL service is stopping.
The MySQL service was stopped successfully.


May I know how to configure Ant to execute a command like this?


-- 

Hez

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


RE: Ant to start and stop Windows service

Posted by Alec Fernandez <Al...@sas.com>.
JFYI, the sc command is a newer and better command for doing this if you are targeting windows XP and later.

-----Original Message-----
From: Burgess, Benjamin [mailto:BBurgess@tiaa-cref.org]
Sent: Wednesday, January 09, 2008 11:20 AM
To: Ant Users List
Subject: RE: Ant to start and stop Windows service

        <target name="start-mysql">
                <exec executable="net" vmlauncher="false">
                        <arg value="start"/>
                        <arg value="mysql"/>
                </exec>
        </target>

-----Original Message-----
From: hezjing [mailto:hezjing@gmail.com]
Sent: Wednesday, January 09, 2008 11:07 AM
To: ant-users
Subject: Ant to start and stop Windows service

Hi

In Windows command window, I used the following command to start and stop MySQL service

> net start mysql
The MySQL service was started successfully.

> net stop mysql
The MySQL service is stopping.
The MySQL service was stopped successfully.


May I know how to configure Ant to execute a command like this?


--

Hez

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

********************************************************************************************
This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.

TIAA-CREF
********************************************************************************************

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


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


RE: Ant to start and stop Windows service

Posted by "Burgess, Benjamin" <BB...@tiaa-cref.org>.
	<target name="start-mysql">
		<exec executable="net" vmlauncher="false">
			<arg value="start"/>
			<arg value="mysql"/>
		</exec>
	</target>

-----Original Message-----
From: hezjing [mailto:hezjing@gmail.com] 
Sent: Wednesday, January 09, 2008 11:07 AM
To: ant-users
Subject: Ant to start and stop Windows service

Hi

In Windows command window, I used the following command to start and
stop MySQL service

> net start mysql
The MySQL service was started successfully.

> net stop mysql
The MySQL service is stopping.
The MySQL service was stopped successfully.


May I know how to configure Ant to execute a command like this?


-- 

Hez

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

********************************************************************************************
This message, including any attachments, contains confidential information intended 
for a specific individual and purpose, and is protected by law. If you are not the intended 
recipient, please contact the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of this message, or
the taking of any action based on it, is strictly prohibited.

TIAA-CREF
********************************************************************************************

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