How can I call a batch file inside a nant script??? (Maybe having a target that calls the batch file).
You may also have to use cmd /c yourbatch.cmd since nant probably doesn't know which program executes batch files.
Joey
2009-03-10 22:54:33
In my tests, cmd /c was not necessary. Just provide the batch file name and like Haugholt said, set the basedir if needed.
Robert Claypool
2010-02-05 17:28:50
+1 for the cmd /c hint. Thanks!
Peter Bernier
2010-09-23 18:40:22
+3
A:
That's pretty easy, actually - i'll try to illustrate:
<target name="run-command">
<exec program="ConsoleTest.exe" basedir="${test.dir}">
<arg value="-cp" />
</exec>
</target>
The basedir is optional, it specifies where to run the program from. But if your program is on the path (like ping), you probably don't have to worry about it.
Have a look at the official documentation as well :)
Haugholt
2009-03-19 17:43:54
+1
A:
Before dropping to a batch file have you considered the tasks in nantcontrib? I needed to smoosh some little javascript files together and was going to use a batch file, but it turns out that nantcontrib has a concat task, for example.
robaker
2009-03-23 12:57:12