Bugfix windows port checker

This commit is contained in:
sirjonasxx 2022-12-27 20:42:43 +01:00
parent 0c74260503
commit 0a7488f6d4

View File

@ -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);
}