aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes .bat Executed Direct from exec Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark ".bat Executed Direct from exec" Watch ".bat Executed Direct from exec" New topic
Author

.bat Executed Direct from exec

Chris Bohannon
Greenhorn

Joined: Jul 28, 2009
Posts: 8

Hello,

I have an Ant related question. According to the Ant manual:

Note that .bat files cannot in general by executed directly. One normally needs to execute the command shell executable cmd using the /c switch.


Here is a code snippet:


This seems to work just fine. I am executing a .bat file directly from the exec task. Now the manual states "general" usage, but I am wondering if I should use the recommend method or is it safe to do what I am doing?

Thanks!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

That might be really old text because if I recall correctly that was a problem many years ago. If it is working for you, go for it.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: .bat Executed Direct from exec