update arrpc

This commit is contained in:
smartfrigde 2023-07-27 17:19:27 +02:00
parent 6c0215313c
commit d0d37caa05

View file

@ -2,16 +2,16 @@ const {exec} = require("child_process");
const getProcesses = () =>
new Promise((res) =>
exec(`wmic process get ProcessID,ExecutablePath /format:csv`, (e, out) => {
exec(`wmic process get ProcessID,ExecutablePath,Name /format:csv`, (e, out) => {
res(
out
.toString()
.split("\r\n")
.slice(2)
.map((x) => {
// [ProcessId, Name, ExecutablePath]
const parsed = x.trim().split(",").slice(1).reverse();
parsed[0] = parseInt(parsed[0]) || parsed[0]; // pid to int
return parsed;
return [parseInt(parsed[0]) || parsed[0], parsed[2] || parsed[1]];
})
.filter((x) => x[1])
);