Running a .cmd file from Ant
问题 Is it possible to run a command (.cmd file) from Ant? Would I need to write Java code for this? 回答1: <exec executable="cmd" os="Windows XP"> <arg value="/C"/> <arg value="command to run"/> </exec> 回答2: You can do this by using the exec task. From the ant exec documentation: Note that .bat files cannot in general by executed directly. One normally needs to execute the command shell executable cmd using the /c switch. So you would need to do something like: <exec executable="cmd"> <arg value="