WSH » WScript » StdIn

Syntax:
WScript.StdIn

The StdIn property returns a read-only TextStream object that reads text from the Standard Input stream. This property is read only and can only be used when cscript is the host executable.

If you attempt to use this property when running a script under wscript, an "Invalid handle" error will be generated.

Examples

Code:
objStdIn = WScript.StdIn
strLine = objStdIn.ReadLine()
WScript.Echo("Read the line\"" + strLine + "\"")
Output:
Read the line "StdIn first line"
Explanation:

This JScript code illustrates the use of this property when run with an input stream that starts with the line "StdIn first line".

Language(s): JavaScript

See Also: