Re: flushing stdout in a HTA ? by Bart
Bart
Tue Jan 24 16:44:48 CST 2006
Here's a copy of a method I put in an HTA, also, to grab some info about a
workstation.
I am populating a variable and then dumping it into the label all at once.
If I were to redo this I'd prbably blank the label out first thing so I can
see the values return. .
Hope this helps.
Bart
~~~~~~~~~~~~~~~~~~~
Sub GetOSVersion
On Error Resume Next
strComputer = GetStrComputer
If Trim(strComputer) <> "" Then
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
If ErrorConnecting(strComputer) = False Then
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
strHTML = strHTML & _
objOperatingSystem.Caption & " " & _
objOperatingSystem.Version & "<br>"
Next
DataArea1.InnerHTML = strHTML
End If
End If
End Sub ' End Sub GetOSVersion
~~~~~~~~~~~~~~~~~~~
<robert.grasso2@gmail.com> wrote in message
news:1138119961.584760.183290@g49g2000cwa.googlegroups.com...
> Hello,
>
> I am quite new to MS-scripting; I wrote a script in .vbs catching
> several OS characteristics for a local computer. Now I would make this
> look pretty, and I am trying to send the output into a .hta : it works
> nicely, but the script is rather slow, and the .hta won't output the
> lines each time I write them, but all the lines at once : so unaware
> people may stay and wonder what is happening.
> Could I flush the output buffer in some way ? I browsed MSDN, but
> without great success.
> I tried outputting to the document itself using :
>
> Set objDocument = self.Document
> objDocument.open
> (...)
> objDocument.writeLn items ...
>
> and also
>
> the <SPAN> DataArea technique. Without success, all the lines are
> output in one time.
>
> (In the .hta, all the instructions are stored in the window_onload
> sub.)
>
> Does anybody have a hint ?
>
> Regards
> R. Grasso
>