I'm having trouble capturing stdout from the run command using script below any ideas????
const ForAppending = 8, forwriting = 2
Set objShell=CreateObject("WScript.Shell")
Set objfso=CreateObject("Scripting.FileSystemObject")
set stdout = wscript.stdout
Set X = objshell.run ("%comspec% /c Reg query ""HKLM\software\microsoft\Windows nt\currentversion""")
Do While X.Status = 0
WScript.Sleep 100
Loop
Do While Not X.StdOut.AtEndOfStream
sLine = X.StdOut.Readline
WScript.Echo sline
If InStr(sline, "currentversion") Then
x = sline
WScript.Echo x
Else
End if
loop
const ForAppending = 8, forwriting = 2
Set objShell=CreateObject("WScript.Shell")
Set objfso=CreateObject("Scripting.FileSystemObject")
set stdout = wscript.stdout
Set X = objshell.run ("%comspec% /c Reg query ""HKLM\software\microsoft\Windows nt\currentversion""")
Do While X.Status = 0
WScript.Sleep 100
Loop
Do While Not X.StdOut.AtEndOfStream
sLine = X.StdOut.Readline
WScript.Echo sline
If InStr(sline, "currentversion") Then
x = sline
WScript.Echo x
Else
End if
loop