diff --git a/G-Earth/src/main/java/gearth/protocol/portchecker/WindowsPortChecker.java b/G-Earth/src/main/java/gearth/protocol/portchecker/WindowsPortChecker.java index 771d946..218796c 100644 --- a/G-Earth/src/main/java/gearth/protocol/portchecker/WindowsPortChecker.java +++ b/G-Earth/src/main/java/gearth/protocol/portchecker/WindowsPortChecker.java @@ -18,7 +18,7 @@ public class WindowsPortChecker implements PortChecker{ } private String getProcessNameFromPid(String pid) throws IOException { - String task = getCommandOutput(new String[] {"tasklist /fi \"pid eq " + pid + "\" /nh /fo:CSV"}); + String task = getCommandOutput(new String[] {"cmd", "/c", "tasklist", "/fi", String.format("pid eq %s", pid) ,"/nh", "/fo:CSV"}); int index = task.indexOf(','); return task.substring(0, index); }