Skip to content

Commit

Permalink
Merge pull request #34 from dazaar/addWindowsParentProcessId
Browse files Browse the repository at this point in the history
Add support for windows parent process ID
  • Loading branch information
neekey authored Jan 23, 2017
2 parents 7f778da + 1b07b1e commit 2a9f849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var Exec = module.exports = exports = function (args, callback) {
callback(stderr, stdout.join(SystemEOL) || false);
});

CMD.stdin.write('wmic process get ProcessId,CommandLine \n');
CMD.stdin.write('wmic process get ProcessId,ParentProcessId,CommandLine \n');
CMD.stdin.end();
}
else {
Expand Down Expand Up @@ -235,7 +235,7 @@ function formatOutput(data) {
data.forEach(function (d) {
var pid = ( d.PID && d.PID[0] ) || ( d.ProcessId && d.ProcessId[0] ) || undefined;
var cmd = d.CMD || d.CommandLine || d.COMMAND || undefined;
var ppid = ( d.PPID && d.PPID[0] ) || undefined;
var ppid = ( d.PPID && d.PPID[0] ) || ( d.ParentProcessId && d.ParentProcessId[0] ) || undefined;

if (pid && cmd) {
var command = cmd[0];
Expand Down

0 comments on commit 2a9f849

Please sign in to comment.