mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-11 09:24:58 +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(/'/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(' '));
|
||||
};
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
hello
|
|
@ -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
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