On Thu, May 12, 2011 at 1:45 PM, shi chuan <shichu...@gmail.com> wrote:
> Hi guys, I am trying to apply a task using Windows executable 'del' to
> delete files, the reason I don't use <delete> is because it will delete even
> if things are up to date.
> However this runs into an error: cannot run program 'del'...error=2
>
> <apply executable="del" dest="./abc/" osfamily="windows"
> addsourcefile="false">

That's because 'del' is not a program, but a builtin 'cmd.exe' "Shell".

That's similar to why http://ant.apache.org/manual/Tasks/exec.html
uses 'cmd -c foo.bat'

Thus try <apply executable="cmd" ...> and add "-c del" as a command
line arg. --DD

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

Reply via email to