How to log the output from cmd tree command using Apache Ant exec task?

Posted by S.N on Stack Overflow See other posts from Stack Overflow or by S.N
Published on 2010-05-10T14:27:38Z Indexed on 2010/05/10 15:44 UTC
Read the original article Hit count: 235

Filed under:
|
|

Hi,

I am trying to log the output from cmd tree command using ant with the following:

    <exec dir="${basedir}" executable="cmd" output="output.txt">
        <arg value="tree" />
    </exec>

However, I am seeing the following in the "output.txt":

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

When I run the command in the windows cmd:

    C:\tree>tree 

I get something like:

    C:\tree
        +---test
            +---test

Can anyone tell me how to write a Ant script to print the tree structure in to a file?

© Stack Overflow or respective owner

Related posts about ant

Related posts about exec