Export (0) Print
Expand All
Expand Minimize

Converting the Windows Script Host ReadAll Method


Windows PowerShell


Definition: Returns all characters from an input stream.

ReadAll


The ReadAll method is designed to read all the data entered into one of the standard I/O data streams (StdIn, StdOut, and StdErr). How useful is that? To be honest, not all that useful; after all, most of the data entered into a script comes from the user typing something at the command-prompt. That’s no problem except that, by definition, data must be entered one line at a time; as soon as the user presses ENTER, the script reads whatever has been typed in. ReadAll does allow you to pipe data into a script using a command similar to this (in this case, the ReadAll method would be deployed within Test.vbs):


dir *.* | Cscript C:\Scripts\Test.vbs


But, to tell you the truth, we aren’t sure how often you need to do that. If you ever do, however, data can be piped to most Windows PowerShell cmdlets without the need for an intermediary such as ReadAll:


dir *.* | Out-File C:\Scripts\Filelist.txt



See conversions of other Windows Script Host methods and properties.
Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft