mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-11 16:35:13 +00:00
fix
This commit is contained in:
parent
7a02f25d8a
commit
94052fa412
|
@ -154,12 +154,6 @@ exports.getNetworkInterfaces = function() {
|
||||||
return rows;
|
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() {
|
exports.getProcesses = function() {
|
||||||
var processes = [];
|
var processes = [];
|
||||||
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
|
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
|
||||||
|
@ -169,20 +163,15 @@ exports.getProcesses = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.killProcess = function(pid) {
|
exports.killProcess = function(pid) {
|
||||||
var processes = exports.getProcessList();
|
var processes = exports.getProcesses();
|
||||||
|
|
||||||
var items = new Enumerator(processes);
|
|
||||||
while (!items.atEnd()) {
|
|
||||||
var proc = items.item();
|
|
||||||
|
|
||||||
|
for (var i = 0; i < processes.length; i++) {
|
||||||
try {
|
try {
|
||||||
if (proc.ProcessId == pid) {
|
if (processes[i].ProcessId == pid) {
|
||||||
proc.Terminate();
|
processes[i].Terminate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
items.moveNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -111,6 +111,6 @@ exports.showNetworkAdapters = function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
exports.showWindowsCopyright = function() {
|
exports.showEULA = function() {
|
||||||
return exports.SHELL32.call("ShellAboutW");
|
return exports.SHELL32.call("ShellAboutW");
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user