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

View File

@ -1 +0,0 @@
hello

View File

@ -1,10 +1,5 @@
@echo off
:: https://stackoverflow.com/questions/12322308/batch-file-to-check-64bit-or-32bit-os
:: 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
cscript app.js unlockfile
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");
}
};