·  ANT – Tags – <exec/>, <arg/>

 

- Info:

  - Used to start executable files like .exe and .bat.

  - You can use command parameter to specifie executable together with all argument.

  - You can use executable parameter to specifie executable and then nested <arg> tags to specifie arguments.

  - command parameter is depricated but executable parameter isn't always working.

 

- Example:

  - Create ANT Script Test.xml

  - Create D:\Temp\ANT\Test.txt

 

    Test.xml

    <?xml version="1.0" encoding="UTF-8"?>

    

    <project name="MyAntProject" default="default" basedir=".">

    

      <target name   ="default">

        <exec command="C:\WINDOWS\system32\notepad.exe Test.txt"/>      

      </target>   

    

    </project>

 

    Test.xml

    <?xml version="1.0" encoding="UTF-8"?>

    

    <project name="MyAntProject" default="default" basedir=".">

      

      <target name="default">

        <exec  executable = "C:\WINDOWS\system32\notepad.exe">   

          <arg value      = "Test.txt"/>

        </exec>   

      </target> 

    

    </project>

 

    Test.txt

    Hello