From 0a7488f6d4ed2f46041530e8b4795a5eecaeab31 Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Tue, 27 Dec 2022 20:42:43 +0100 Subject: [PATCH] Bugfix windows port checker --- .../java/gearth/protocol/portchecker/WindowsPortChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }