Solved

Send Wscript.echo to a text box.

Posted on 2003-10-21
1
1,705 Views
Last Modified: 2013-12-26
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

Next

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.

Cheers,
Ribuck.
0
Comment
Question by:ribuck
1 Comment
 
LVL 44

Accepted Solution

by:
bruintje earned 500 total points
ID: 9590498
try

text1 = text1.Text & objItem.Caption & vbCrLf

hope this helps a bit
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now