I'm looking to create a Java Application that is able to run windows commands in a "batch" manner; what I mean by this is that it's persistent in between commands and isn't as if you're only executing one at a time.
An example of this might be:
@echo off
pushd C:\foldertobepushedto\
call batchfiletobecalled.bat
popd
pushd anotherdirectorytobepushedinto
call anotherbatchfiletobecalled.bat
popd
I would like to be able to use the Process process = Runtime.getRuntime().exec(CMD);
manner to be able to run each of these lines but kept persistent so that it's not as if each line is run completely separate from the rest of them.
I hope I am making a bit of sense; I intend to essentially remove the use of batch files all together and store each line as an element in a vector/array and execute them "batch" style that way.