How can I escape double-quotes in ant?

sachin picture sachin · Sep 12, 2011 · Viewed 42.4k times · Source

I need to exec the following command from ant, but I can't figure out how to escape the double-quotes:

tasklist /FI "IMAGENAME eq java.exe" /FI "MEMUSAGE gt 50000"

Answer

Michael Mrozek picture Michael Mrozek · Sep 12, 2011

Ant uses XML, so you can use the normal XML entities like ":

tasklist /FI "IMAGENAME eq java.exe" /FI "MEMUSAGE gt 50000"