mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
fix
This commit is contained in:
parent
7a02f25d8a
commit
94052fa412
|
@ -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;
|
||||
|
|
|
@ -111,6 +111,6 @@ exports.showNetworkAdapters = function() {
|
|||
|
||||
/**
|
||||
*/
|
||||
exports.showWindowsCopyright = function() {
|
||||
exports.showEULA = function() {
|
||||
return exports.SHELL32.call("ShellAboutW");
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user