*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to run a batch file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to run a batch file " Watch "How to run a batch file " New topic
Author

How to run a batch file

Pradeep Kumar
Ranch Hand

Joined: Sep 11, 2007
Posts: 77
Hi all,
Can someone help me out with the ant command to run a batch file or an exe command.


Thanks and Regards,
Pradeep Kumar


SCJP 1.6
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
http://ant.apache.org/faq.html#batch-shell-execute

Note that on older windows system, or non-standard installations, the command might be different from "cmd". Which command shell is used by the windows system by default is recorded in the ComSpec environment variable, so you might want to use that instead of the hardcoded "cmd".


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Chetan Sachdev
Greenhorn

Joined: May 13, 2008
Posts: 1
Thanks

That solution worked for me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to run a batch file
 
Similar Threads
Ant tool?
How to run dos batch file from java program
java program that can run a .class file in msdos, is this possible?
Calling Java Program form a batch file
How To Compile Servlet