Re: [MSH] Requires an executable on the RHS of a pipe?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



please log a bug

--
James W. Truher [MSFT]
Monad Program Management
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Bill Stewart" <llib.trawets@xxxxxxxxxxxxxxxxxx> wrote in message
news:OGPmk%23gQGHA.3872@xxxxxxxxxxxxxxxxxxxxxxx
It appears that MSH requires an executable on the right-hand side of a
pipe. If I attempt to pipe to a WSH script without specifying the script
interpreter's file name (i.e., cscript), MSH returns error 193 ("%1 is not
a valid Win32 application").

The below example is executed on a machine where cscript is the default
WSH host (cscript //H:CScript).

MSH C:\> get-content Test.js
var tsinput = WScript.StdIn, tsoutput = WScript.StdOut;

while (! tsinput.AtEndOfStream)
tsoutput.WriteLine(tsinput.ReadLine());
MSH C:\> get-childitem | Test.js
Program 'Test.js' failed to execute: The specified executable is not a
valid Win32 application.
At line:1 char:23
+ get-childitem | Test.js <<<< .
At line:1 char:1
+ g <<<< et-childitem | Test.js
MSH C:\>

Now, we already know that cmd.exe's input redirection is broken (see
http://groups.google.com/group/microsoft.public.scripting.wsh/browse_frm/thread/fba088728d73eb02),
but it would be nice if this was "fixed" in MSH.

--
Bill Stewart


.



Relevant Pages

  • Re: [MSH] Requires an executable on the RHS of a pipe?
    ... console redirection is a tricky thing. ... [MSH] Requires an executable on the RHS of a pipe? ...
    (microsoft.public.windows.server.scripting)
  • Re: Question about pipes and terminals
    ... the user should be able to use the shell normally. ... > that the child has finished directly it all worked well. ... > process through a pipe. ... Now when i execute a shell, ...
    (comp.os.linux.development.system)
  • Re: pysqlite
    ... > works if I pipe my file into sqlite, but when I execute the same data as ... > a giant string I get no error, ...
    (comp.lang.python)
  • Re: [MSH] Requires an executable on the RHS of a pipe?
    ... this feature contributes significantly to the performance profile of tab completion. ... [MSH] Requires an executable on the RHS of a pipe? ...
    (microsoft.public.windows.server.scripting)
  • Re: Syntax query
    ... I suspect grep and awk commands are ... Don't forget to verify that the pipe also closed correctly: ...
    (perl.beginners)