Login | |
|
 |
RE: Looping problem overwriting my last data output - 6/17/2008 5:13:29 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
<head> <title>HTA Test</title> <HTA:APPLICATION APPLICATIONNAME="HTA Test" SCROLL="yes" SINGLEINSTANCE="yes" > </head> <script language="VBScript"> Sub GetOSVersion strMachines = "computer1; computer2; computer3" aMachines = split(strMachines, ";") For Each machine in aMachines Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & machine & "\root\cimv2") Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For Each objOS in colOSes strHTML = strHTML & "<table border='1' style='border-collapse: collapse' bordercolor='SaddleBrown' id='Table1' >" strHTML = strHTML & "<tr>" strHTML = strHTML & "<td width='10%'>" & "<b>Computer Name: </b>" & objOS.CSName & "</td>" strHTML = strHTML & "<td width='10%'>" & "<b>Operating System: </b>" & objOS.Caption 'Name & "</td>" strHTML = strHTML & "<td width='10%'>" & "<b>Version: </b>" & objOS.Version 'Version & build & "</td>" strHTML = strHTML & "<td width='10%'>" & "<b>Service Pack: </b>" & objOS.ServicePackMajorVersion & "." & objOS.ServicePackMinorVersion & "</td>" strHTML = strHTML & "</tr>" strHTML = strHTML & "</table>" Next Next DataArea.InnerHTML = strHTML End Sub </script> <body> <input type="button" value="Operating System" onClick="GetOSVersion"> <p> <span id = "DataArea"></span> <br> </body>
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|