I am trying to execute the following on the command line via the java runtime environment.
Runtime rt = Runtime.getRuntime();
String runtime = "cmd /c start cmd.exe /k \"cd /d C:\\Users\\User\\Documents\\ & python book.py \" "
rt.exec(runtime);
When running the command prompt directly, i.e. python book.py (assuming that I have already changed the location to the correct directory), python runs fine without any issues.
However, when done through java, the command prompt window looks different, with C:\WINDOWS\system32\cmd.exe instead of displaying Command Prompt.
The above java runtime also gives me 'python' is not recognized as an internal or external command, operable program or batch file. (Whereas the normal command prompt the runs python perfectly fine)
How would I go about including my path and environment variables such that python, or any other path/environment variable, is recognized when I run the command prompt from java?