P
Priyanka AGARWAL
I have a problem with Runtime.exec command when I want to execute it
in the working directory.
My Runtime.exec command calls an external Application(Samcef) which
uses certain environment variables
and licence for calling the external application.
I have used this command:-
.............
.............
String[] sz_env = {""};
String sz_working_directory = D:\\users
String sz_execute_cmd = sz_Samcef_exe + " ba,as iteration n 1 <
samcef_input.dat";
Process wait = Runtime.getRuntime().exec(sz_exec_command, sz_env, new
File(sz_working_directory));
.............
.............
It does'nt take the existing environment settings of the operating
system.
But if I use this command from command prompt it works fine.
If I use cmd /c ,go to the working directory using cd then it works
fine.
But I dont want to use cmd/c , I want it to work both on windows and
unix.
in the working directory.
My Runtime.exec command calls an external Application(Samcef) which
uses certain environment variables
and licence for calling the external application.
I have used this command:-
.............
.............
String[] sz_env = {""};
String sz_working_directory = D:\\users
String sz_execute_cmd = sz_Samcef_exe + " ba,as iteration n 1 <
samcef_input.dat";
Process wait = Runtime.getRuntime().exec(sz_exec_command, sz_env, new
File(sz_working_directory));
.............
.............
It does'nt take the existing environment settings of the operating
system.
But if I use this command from command prompt it works fine.
If I use cmd /c ,go to the working directory using cd then it works
fine.
But I dont want to use cmd/c , I want it to work both on windows and
unix.