This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java code for running batch file

 
rahul itapure
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic