I try to check if a service is installed on Windows using:
Process p = Runtime.getRuntime().exec(
"sc query type= service state= all | find\"postgresql\"");
but the output is exactly as if I had executed the sc command by itself (a help message). When executing the same string via cmd it works correctly.