I am running a java program on windows 10 workstation.
I wanted to run my java program as a service so i used apache commons tool prunserv http://commons.apache.org/proper/commons-daemon/procrun.html
Issue is my java program runs some windows shell commands inside it like cmd \c netstat -rn
but when i start my java program as a service and specify StartPath as some directory. commands inside my java programs fail with error like below
Error executing command : [cmd, /c, netstat, -rn], Output is : 'netstat' is not recognized as an
internal or external command,
operable program or batch file.
I feel like StartPath argument of procrun is overriding PATH variables like C:\Windows\System32 thus making command inside java program to fail
--StartPath Working path for the start image executable.
How should i deal with this situation ?
Let me know if you need any further details.
Thanks in advance for help.