You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by arijit <gh...@wipro.com> on 2007/06/20 14:27:45 UTC

executing batch files in separate windows

I have a build file from which I am trying to execute a series of batch
files. I am trying to execute the batch files in their own respective dos
prompts.

Is this possible ? Using <exec> starts the batch files in the same dos
prompt.


-- 
View this message in context: http://www.nabble.com/executing-batch-files-in-separate-windows-tf3952030.html#a11212233
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: AW: AW: executing batch files in separate windows

Posted by arijit <gh...@wipro.com>.
Thanks Jan. That is a cleaner approach..


Jan.Materne wrote:
> 
> You could it more readable with
> 
> <project>
> 
>     <macrodef name="bat">
>         <attribute name="file"/>
>         <sequential>
>             <exec executable="cmd" spawn="true">
>                 <arg line="/c start @{file}"/>
>             </exec>            
>         </sequential>
>     </macrodef>
>     
>     <bat file="first.bat"/>
>     <bat file="second.bat"/>
> 
> </project>
> 
> 
> Jan
> 
>>-----Ursprüngliche Nachricht-----
>>Von: arijit [mailto:ghosh.arijit@wipro.com] 
>>Gesendet: Mittwoch, 20. Juni 2007 16:00
>>An: user@ant.apache.org
>>Betreff: Re: AW: executing batch files in separate windows
>>
>>
>>Thanks Steve. Got it working.
>>
>>Posting the solution for other's reference --
>>
>><target name="test">
>>
>> <exec executable="cmd" spawn="true">
>>   <arg line="/c start first.bat"/>
>> </exec>
>>		
>> <exec executable="cmd" spawn="true">
>>   <arg line="/c start second.bat"/>
>> </exec>
>>
>></target>  
>>
>>
>>Steve Loughran wrote:
>>> 
>>> arijit wrote:
>>>> Thanks Jan. Unfortunately I am not an expert in ANT. Can 
>>you provide some
>>>> more code to show how I can run the batch files in separate 
>>dos prompts ?
>>>> 
>>>> 
>>> 
>>> do you mean you actually want the windows to pop up? Thats no longer 
>>> ant, that's windows.
>>> 
>>> you need to exec the program "start". Before you start 
>>rushing out lots 
>>> of support emails related to it
>>> 
>>> 1. start /? will list the options
>>> 2. those of us who moved to linux many years ago cannot provide help
>>> 
>>> -steve
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>> 
>>> 
>>> 
>>
>>-- 
>>View this message in context: 
>>http://www.nabble.com/executing-batch-files-in-separate-windows
>>-tf3952030.html#a11214005
>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>>---------------------------------------------------------------------
>>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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/executing-batch-files-in-separate-windows-tf3952030.html#a11229852
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: AW: executing batch files in separate windows

Posted by arijit <gh...@wipro.com>.
Thanks Steve. Got it working.

Posting the solution for other's reference --

<target name="test">

 <exec executable="cmd" spawn="true">
   <arg line="/c start first.bat"/>
 </exec>
		
 <exec executable="cmd" spawn="true">
   <arg line="/c start second.bat"/>
 </exec>

</target>  


Steve Loughran wrote:
> 
> arijit wrote:
>> Thanks Jan. Unfortunately I am not an expert in ANT. Can you provide some
>> more code to show how I can run the batch files in separate dos prompts ?
>> 
>> 
> 
> do you mean you actually want the windows to pop up? Thats no longer 
> ant, that's windows.
> 
> you need to exec the program "start". Before you start rushing out lots 
> of support emails related to it
> 
> 1. start /? will list the options
> 2. those of us who moved to linux many years ago cannot provide help
> 
> -steve
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/executing-batch-files-in-separate-windows-tf3952030.html#a11214005
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: AW: executing batch files in separate windows

Posted by Steve Loughran <st...@apache.org>.
arijit wrote:
> Thanks Jan. Unfortunately I am not an expert in ANT. Can you provide some
> more code to show how I can run the batch files in separate dos prompts ?
> 
> 

do you mean you actually want the windows to pop up? Thats no longer 
ant, that's windows.

you need to exec the program "start". Before you start rushing out lots 
of support emails related to it

1. start /? will list the options
2. those of us who moved to linux many years ago cannot provide help

-steve

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


Re: AW: executing batch files in separate windows

Posted by arijit <gh...@wipro.com>.
I tried using the spawn attriute by setting it to true. However, it does not
start the batch files in separate windows. All the batch files start
executing in the same dos window where the ant build file is being executed.
Fork attribute is not supported by <exec>.

Any suggestion ?


arijit wrote:
> 
> Thanks Jan. Unfortunately I am not an expert in ANT. Can you provide some
> more code to show how I can run the batch files in separate dos prompts ?
> 
> 
> Jan.Materne wrote:
>> 
>> <exec fork+spawn>
>> 
>> Jan
>> 
>>>-----Ursprüngliche Nachricht-----
>>>Von: arijit [mailto:ghosh.arijit@wipro.com] 
>>>Gesendet: Mittwoch, 20. Juni 2007 14:28
>>>An: user@ant.apache.org
>>>Betreff: executing batch files in separate windows
>>>
>>>
>>>I have a build file from which I am trying to execute a series of batch
>>>files. I am trying to execute the batch files in their own 
>>>respective dos
>>>prompts.
>>>
>>>Is this possible ? Using <exec> starts the batch files in the same dos
>>>prompt.
>>>
>>>
>>>-- 
>>>View this message in context: 
>>>http://www.nabble.com/executing-batch-files-in-separate-windows
>>>-tf3952030.html#a11212233
>>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/executing-batch-files-in-separate-windows-tf3952030.html#a11213182
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: AW: executing batch files in separate windows

Posted by arijit <gh...@wipro.com>.
Thanks Jan. Unfortunately I am not an expert in ANT. Can you provide some
more code to show how I can run the batch files in separate dos prompts ?


Jan.Materne wrote:
> 
> <exec fork+spawn>
> 
> Jan
> 
>>-----Ursprüngliche Nachricht-----
>>Von: arijit [mailto:ghosh.arijit@wipro.com] 
>>Gesendet: Mittwoch, 20. Juni 2007 14:28
>>An: user@ant.apache.org
>>Betreff: executing batch files in separate windows
>>
>>
>>I have a build file from which I am trying to execute a series of batch
>>files. I am trying to execute the batch files in their own 
>>respective dos
>>prompts.
>>
>>Is this possible ? Using <exec> starts the batch files in the same dos
>>prompt.
>>
>>
>>-- 
>>View this message in context: 
>>http://www.nabble.com/executing-batch-files-in-separate-windows
>>-tf3952030.html#a11212233
>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>>---------------------------------------------------------------------
>>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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/executing-batch-files-in-separate-windows-tf3952030.html#a11212873
Sent from the Ant - Users mailing list archive at Nabble.com.


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