I am unsure if context is the right word to use here but what i mean is something like
cd .\test
test.exe
test.exe is located in the folder test and I want to run it from the folder test, I know I can run
.\test\test.exe
but I need test.exe to be run from the folder test.
Is there a way to run both commands in the same "context"?
I have tried:
String cmd1 = "cmd /C cd test";
String cmd2 = "test.exe";
CommandLine cmdl1 = CommandLine.parse(cmd1);
CommandLine cmdl2 = CommandLine.parse(cmd2);
DefaultExecutor exec = new DefaultExecutor();
exec.execute(cmdl1);
exec.execute(cmdl2);
but as expected it could not find test.exe
.