My software is a BAT-file which runs:
start java -jar my.jar`
The Java code does a:
Runtime.getRuntime().exec("CMD /C START OtherProgram.exe -SomeParameters=Value");
For most this works fine, but for this one special individual I experience that OtherProgram.exe
is not found:
This although it is quite clearly in the PATH
environment variable when we start the jar and also when printing the PATH
from within the Java code. Iseem to be losing the PATH in the new cmd
, but my understanding is that this is just pure inheritance. How could I have gone wrong?
As this happens for only a single individual (sample size 10), could it be some sort of permission? Some Windows settings that somehow prevent the PATH
inheritance or uses another PATH
than that of the original cmd
? Thanks.