encode arg for cscript

This commit is contained in:
anseki 2015-03-27 21:12:00 +09:00
parent 67d20da312
commit 16db4b4c1c
2 changed files with 3 additions and 2 deletions

View file

@ -2,7 +2,7 @@
var var
FSO_ForReading = 1, FSO_ForWriting = 2, FSO_ForReading = 1, FSO_ForWriting = 2,
PS_MSG = 'Microsoft Windows PowerShell is required.\n' + PS_MSG = 'Microsoft Windows PowerShell is required.' +
' https://technet.microsoft.com/en-us/library/hh847837.aspx', ' https://technet.microsoft.com/en-us/library/hh847837.aspx',
input, fso, tty, input, fso, tty,

View file

@ -212,6 +212,7 @@ function readlineExt(options) {
} }
} }
if (IS_WIN && !process.env.PSModulePath) { // Windows Script Host if (IS_WIN && !process.env.PSModulePath) { // Windows Script Host
options.encoded = true; // Parsing args is DOS?
// ScriptPW (Win XP and Server2003) needs TTY stream as STDIN. // ScriptPW (Win XP and Server2003) needs TTY stream as STDIN.
// In this case, If STDIN isn't TTY, an error is thrown. // In this case, If STDIN isn't TTY, an error is thrown.
execOptions.stdio = [process.stdin]; execOptions.stdio = [process.stdin];