Skip to content

Instantly share code, notes, and snippets.

@dstyle0210
Last active February 8, 2023 05:41
Show Gist options
  • Select an option

  • Save dstyle0210/dfab028c2b70d128b8032f0dedddbc4c to your computer and use it in GitHub Desktop.

Select an option

Save dstyle0210/dfab028c2b70d128b8032f0dedddbc4c to your computer and use it in GitHub Desktop.
iexplore.exe 실행중인 pid 목록 가져오기
const exec = require("child_process").exec;
// 임시버전
const selectPidIExplore = () => {
return new Promise(() => {
exec(`tasklist | findstr "iexplore.exe"`,(err,stdout,stderr) => {
const pids = stdout.split(/\n/).map((row) => {
return row.trim().split(/\s+/)[1];
});
pids.pop(); // stdout 스플릿 상, 마지막 빈줄이 들어감. 제외처리
resolve(pids);
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment