1

I have searched alot found some similar questions and answers too on StackOverflow but nothing worked.

I'm creating an application in Java where I need to open command prompt and run series of lots of commands in that using Java code itself.

I am able to open the cmd.exe but how to run those commands inside the cmd using only Java Code.

Anyhelp would be appreciated :)

Abhi
  • 1,080
  • 1
  • 7
  • 21
  • http://stackoverflow.com/questions/20202853/runtime-exec-commands-do-not-execute-successively – older coder May 09 '17 at 15:54
  • 1
    If they need to run in a single command window instance, you probably need to write a temporary .bat file and execute that. – VGR May 09 '17 at 17:41
  • @VGR +1 Have the Java code write the .bat file script, then have Java run that in a cmd.exe shell. – lit May 09 '17 at 22:15
  • Yes I need to run in a single command window instance... Any code to do that ? – Abhi May 10 '17 at 05:30

0 Answers0