WriteBlankLines Method (Windows Script Host)

Sends a specified number of blank lines (newline characters) to an output stream.



StdOut or StdErr text stream objects.


Integer value indicating the number of blank lines you want to write to the stream.

Calling the WriteLine method without supplying the strText argument is equivalent to calling WriteBlankLines(1). 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 following code demonstrates the WriteBlankLines method.

Dim StdIn, StdOut
Set StdIn = WScript.StdIn
Set StdOut = WScript.StdOut

Do While Not StdIn.AtEndOfStream
     str = StdIn.ReadLine
     StdOut.Write "Line " & (StdIn.Line - 1) & ": " & str
     StdOut.WriteBlankLines 1
var stdin = WScript.StdIn;
var stdout = WScript.StdOut;

while (!stdin.AtEndOfStream)
     var str = stdin.ReadLine();
     stdout.Write("Line " + (stdin.Line - 1) + ": " + str);

Community Additions