mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 13:41:05 +00:00
fix
This commit is contained in:
parent
be70c01671
commit
a200c51364
24
app.js
24
app.js
|
@ -69,16 +69,24 @@ var console = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(typeof(GetObject) !== "function") {
|
if(typeof(CreateObject) !== "function") {
|
||||||
function GetObject(pathName, className) {
|
var CreateObject = function(className) {
|
||||||
console.warn("Not supported function GetObject() in GUI mode");
|
return new ActiveXObject(className);
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof(CreateObject) !== "function") {
|
if(typeof(GetObject) !== "function") {
|
||||||
function CreateObject(className) {
|
var GetObject = function(pathName, className) {
|
||||||
return new ActiveXObject(className);
|
var paths = pathName.split("\\");
|
||||||
};
|
if(paths[0].indexOf("winmgmts:") > -1) {
|
||||||
|
var objLocator = CreateObject("WbemScripting.SWbemLocator");
|
||||||
|
var strComputer = paths[2];
|
||||||
|
var strNamespace = paths.slice(3).join("\\");
|
||||||
|
return objLocator.ConnectServer(strComputer, strNamespace);
|
||||||
|
} else {
|
||||||
|
console.log("Not supported: " + pathName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function require(FN) {
|
function require(FN) {
|
||||||
|
|
|
@ -63,6 +63,8 @@ return {
|
||||||
}
|
}
|
||||||
|
|
||||||
SHELL.run(commandOptions.join(' '));
|
SHELL.run(commandOptions.join(' '));
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user