I wish to create a script file for Windows, that is, a .cmd file to start my java project.
It makes sense to create the file from within ant so any changes to the class path are reflected in the script. But what is the best way to create a Windows script file from within ant? Using <echo> does not terminate the end-of-lines for Windows correctly (must default for unix?). An extract from my ant script... <target name="dist" depends="init, jar"> ... <pathconvert targetos="windows" property="dist.libs" refid="build.classpath"/> <echo file="${dist.bin}/${corename}.cmd">@echo off setlocal set classpath=${jar.filename};${dist.libs} java ${main.class} -cp %classpath% </echo>