@echo off
cd kr\Datapack
start C:\ant\bin\ant clean dist >> log.txt
Куда то в эту сторону копать надо .
Или читать доку по ant и сделать так :
start C:\ant\bin\ant -logfile log.txt clean dist
ant [options] [target [target2 [target3] ...]]
Options:
-help, -h print this message
-projecthelp, -p print project help information
-version print the version information and exit
-diagnostics print information that might be helpful to
diagnose or report problems.
-quiet, -q be extra quiet
-verbose, -v be extra verbose
-debug, -d print debugging information
-emacs, -e produce logging information without adornments
-lib
-logfile
-l
-logger
-listener
-noinput do not allow interactive input
-buildfile
-file
-f
-D
-keep-going, -k execute all targets that do not depend
on failed target(s)
-propertyfile
properties taking precedence
-inputhandler
-find
-s
-nice number A niceness value for the main thread:
1 (lowest) to 10 (highest); 5 is the default
-nouserlib Run ant without using the jar files from ${user.home}/.ant/lib
-noclasspath Run ant without using CLASSPATH
-autoproxy Java 1.5+ : use the OS proxies
-main