Update lib/autoit.js, Create registerDLLs.bat

This commit is contained in:
Namhyeon Go 2022-02-10 12:42:11 +09:00
parent 67d365026a
commit 82713e1588
3 changed files with 7 additions and 43 deletions

View File

@ -39,7 +39,7 @@ function AutoItObject() {
if (this.interface != null) {
try {
//this.interface[functionName].apply(args);
//this.interface[functionName].apply(null, args);
eval("this.interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")");
} catch (e) {
console.error("AutoItObject.callFunction() ->", e.message);

View File

@ -1,43 +1 @@
////////////////////////////////////////////////////////////////////////
// Powershell API
///////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell");
exports.VERSIONINFO = "Powershell (powershell.js) version 0.1";
exports.global = global;
exports.require = global.require;
exports.execScript = function(scriptName, args) {
var cmd = [
"powershell.exe",
"-NoProfile",
"-ExecutionPolicy",
"ByPass",
"-nologo",
"-file",
scriptName + ".ps1"
];
if (typeof(cmd) !== "undefined") {
cmd = cmd.concat(args);
}
return SHELL.exec(cmd);
};
exports.execCommand = function(cmd) {
return SHELL.exec([
"powershell.exe",
"-NoProfile",
"-ExecutionPolicy",
"ByPass",
"-nologo",
"-Command",
"& {" + cmd + "}"
]);
};
exports.runAs = function(cmd) {
return exports.execCommand("Start-Process cmd \"/q /c " + SHELL.addslashes(SHELL.makeCmdLine(cmd)) + "\" -Verb RunAs");
};

6
registerDLLs.bat Normal file
View File

@ -0,0 +1,6 @@
@echo off
regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3.dll"
regsvr32 /s "%PROGRAMFILES(X86)%\AutoIt3\AutoItX\AutoItX3_x64.dll"
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll
%WINDIR%\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll
pause