update unlockfile processes

This commit is contained in:
Namhyeon Go 2020-07-19 06:27:46 +09:00
parent 37ce425a1c
commit 83a026b6b6
6 changed files with 31 additions and 28 deletions

Binary file not shown.

Binary file not shown.

View File

@ -15,18 +15,18 @@ scope.addslashes = function(string) {
replace(/\r/g, '\\r'). replace(/\r/g, '\\r').
replace(/'/g, '\\\''). replace(/'/g, '\\\'').
replace(/"/g, '\\"'); replace(/"/g, '\\"');
} };
scope.execScript = function(scriptName, args) { scope.execScript = function(scriptName, args) {
var arguments = [ var arguments = [];
"powershell.exe",
"-NoProfile", arguments.push("powershell.exe");
"-ExecutionPolicy", arguments.push("-NoProfile");
"ByPass", arguments.push("-ExecutionPolicy");
"-nologo", arguments.push("ByPass");
"-file", arguments.push("-nologo")
scriptName + ".ps1" arguments.push("-file");
]; arguments.push(scriptName + ".ps1");
if(typeof(args) !== "undefined") { if(typeof(args) !== "undefined") {
for(var i in args) { for(var i in args) {
@ -38,17 +38,17 @@ scope.execScript = function(scriptName, args) {
}; };
scope.execCommand = function(command) { scope.execCommand = function(command) {
var arguments = [ var arguments = [];
"powershell.exe",
"-NoProfile", arguments.push("powershell.exe");
"-ExecutionPolicy", arguments.push("-NoProfile");
"ByPass", arguments.push("-ExecutionPolicy");
"-nologo" arguments.push("ByPass");
"-Command", arguments.push("-nologo")
"\"& {", arguments.push("-Command");
scope.addslashes(command), arguments.push("\"& {");
"}\"" arguments.push(scope.addslashes(command));
]; arguments.push("}\"");
return SHELL.exec(arguments.join(' ')); return SHELL.exec(arguments.join(' '));
}; };

View File

@ -1 +0,0 @@
hello

View File

@ -1,10 +1,5 @@
@echo off @echo off
:: https://stackoverflow.com/questions/12322308/batch-file-to-check-64bit-or-32bit-os cscript app.js unlockfile
:: https://support.microsoft.com/ko-kr/help/556009
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
if %OS%==32BIT bin\streams.exe -d app.hta
if %OS%==64BIT bin\streams64.exe -d app.hta
echo done echo done

9
unlockfile.js Normal file
View File

@ -0,0 +1,9 @@
var PS = require("lib/powershell");
return {
main: function() {
console.log("Starting unlock files...");
PS.execCommand("dir | Unblock-File");
console.log("done");
}
};