mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +00:00
update unlockfile processes
This commit is contained in:
parent
37ce425a1c
commit
83a026b6b6
BIN
bin/streams.exe
BIN
bin/streams.exe
Binary file not shown.
Binary file not shown.
|
@ -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(' '));
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
hello
|
|
|
@ -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
9
unlockfile.js
Normal 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");
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user