Run command line structure in Java
Dear friends
I want to run a Python executable file. In this command i call the python (already installed in windows) and execute the .py file by some parameters.
Code :
D:\pyhon27\python D:\python27\cp_wordnet.py 2 2 2 2r 2e 3ssd 2dfdf 2 1 2 2
whenever i type this command in 'cmd' in windows and execute it, it runs and i have the result, but i don't know how can i do same process in Java !
I tried these commands in java, but they don't work
The 'path' is String and equal to 'D:\pyhon27\python D:\python27\cp_wordnet.py 2 2 2 2r 2e 3ssd 2dfdf 2 1 2 2'
Code :
Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+ path);
Process p = Runtime.getRuntime().exec("cmd /c "+ path);
Process p = Runtime.getRuntime().exec("rundll64 SHELL64.DLL,ShellExec_RunDLL "+ path);
Process p = Runtime.getRuntime().exec(path);
Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler d:/python/wordnet.py");
could somebody pleas help meee