.StdOut.ReadLine

Obtain User Input from the command prompt or retrieve (screen scrape) text from the output of a program.
Syntax
.StdOut.ReadLine()

Examples

' Read a single line into a variable
Dim strMyName
WScript.StdOut.Write("Enter Your full Name>")
WScript.StdIn.Read(0)
strMyName = WScript.StdIn.ReadLine()
WScript.StdOut.Write(strMyName)


' Read program output into a variable line by line
Dim ObjExec
Dim strFromProc

Set WshShell = WScript.CreateObject("WScript.Shell")
Set ObjExec = WshShell.Exec("cmd.exe /c dir")
Do
strFromProc = ObjExec.StdOut.ReadLine()
WScript.Echo "ABC " & strFromProc & " DEF"
Loop While Not ObjExec.Stdout.atEndOfStream

Make a Free Website with Yola.