wood burning stoves 2.0*
The moose likes Java in General and the fly likes java code for running batch file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java code for running batch file" Watch "java code for running batch file" New topic
Author

java code for running batch file

rahul itapure
Greenhorn

Joined: Sep 16, 2005
Posts: 1
hi
I am trying to run batch file from java.
I have done with following but it is not working .

try
{
Runtime rt= Runtime.getRuntime();
String args1="C:\\Repository\\Repository_Automation\\sample.bat";
Process proc=rt.exec(args1);
}
catch(IOException e)
{
System.out.println(e);
}


It works for exe file.
Please let me know the solution.
Khan Malamir
Greenhorn

Joined: Sep 09, 2005
Posts: 16
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java code for running batch file