This commit is contained in:
Namhyeon Go 2020-11-13 18:47:03 +09:00
parent 7a02f25d8a
commit 94052fa412
2 changed files with 5 additions and 16 deletions

View File

@ -154,12 +154,6 @@ exports.getNetworkInterfaces = function() {
return rows;
};
exports.getProcessList = function() {
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
var query = "Select * From Win32_Process";
return wmi.ExecQuery(query);
};
exports.getProcesses = function() {
var processes = [];
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
@ -169,20 +163,15 @@ exports.getProcesses = function() {
};
exports.killProcess = function(pid) {
var processes = exports.getProcessList();
var items = new Enumerator(processes);
while (!items.atEnd()) {
var proc = items.item();
var processes = exports.getProcesses();
for (var i = 0; i < processes.length; i++) {
try {
if (proc.ProcessId == pid) {
proc.Terminate();
if (processes[i].ProcessId == pid) {
processes[i].Terminate();
return true;
}
} catch (e) {}
items.moveNext();
}
return false;

View File

@ -111,6 +111,6 @@ exports.showNetworkAdapters = function() {
/**
*/
exports.showWindowsCopyright = function() {
exports.showEULA = function() {
return exports.SHELL32.call("ShellAboutW");
};