Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

Write Method (Windows Script Host)

Sends a string to an output stream.


                      object.Write(strText) 
object

StdOut or StdErr text stream objects.

strText

String value indicating the text you want to write to the stream.

The StdIn, StdOut, and StdErr properties and methods work when running the script with the CScript.exe host executable file only. An "Invalid Handle" error is returned when run with WScript.exe. The position pointer moves to the point just beyond the last character in strText.

The following code demonstrates the use of the Write method.

Dim strInput
strInput = WScript.StdIn.ReadAll
WScript.StdOut.Write strInput
var strInput = WScript.StdIn.ReadAll();
WScript.StdOut.Write(strInput);

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.