Send Wscript.echo to a text box.
Posted on 2003-10-21
Hi all, I have wrote a script which poll's a remote machine for information. Let's use the following example a test case scenario.
On Error Resume Next
strComputer = "Machinexxx"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
The problem I am having is that i want to output the result of the Wscript.Echo "Caption: " & objItem.Caption to a text box, so instead i used the following code.
text1 = objItem.Caption & vbCrLf
Ok great, this now displays the result in the text box. The problem is that the argument may return lots of results, but only the last result is displayed in the text box, hence none of the previous results are displayed.
I have tried setting the text box property to "MultiLine" but still no joy, please help as i'm pulling my hair out.