Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I need to call a batch file from java and pass arguments to that Batch file

807603Oct 17 2007 — edited Oct 18 2007
Hi,

I need to call a batch file from java and pass arguments to that Batch file.
For example say: The batch file(test.bat) contains this command: mkdir

I need to pass the name of the directory to the batch file as an argument from My Java program.

Runtime.getRuntime().exec("cmd /c start test.bat");

How to pass argument to the .bat file from Java now ?

regards,
Krish

Edited by: Krish4Java on Oct 17, 2007 2:47 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2007
Added on Oct 17 2007
8 comments
10,910 views