This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java code for running batch file" Watch "java code for running batch file" New topic

java code for running batch file

rahul itapure

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

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

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

Joined: Sep 09, 2005
Posts: 16
I agree. Here's the link:
subject: java code for running batch file
Similar Threads
yet another ArrayIndexOutOfBoundsException
Running a java program from within another one
java program that can run a .class file in msdos, is this possible?
How to Run a batch file???
.class file execution