Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Combining 2 htas to make one hta

Posted on 2009-05-07
8
Medium Priority
?
325 Views
Last Modified: 2012-05-06
Hi nice people.
Guys,
I have 2 hta scripts that I would like to combine into one hta.
I have attached in the code snippet both hta scripts, and have simply called them hta1 (architecture) and hta2 (service pack).
The objective is to:
Be able to select to return just the service pack, or just the architecture, or both service pack and architecture, and output the results in tables.
More explanation is attached in an image i have uploaded.
Any help would be greatly appreciated. Thanks everyone.
'======================================================== hta1 (architecture):
 
<head>
<title>Enumerate System Information on Remote Computers</title>
<HTA:APPLICATION 
     APPLICATIONNAME="Enumerate System Information"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
<style type="text/css">
 
html {
font-family:arial;
font-size:smaller;
 
}
 
table {
border-collapse:collapse;
border:solid 1px black;
font-family:arial;
font-size:0.8em;
}
 
tr, td, th {
border-collapse:collapse;
border-style:solid;
}
 
td { border-width: 1px; }
 
 
</style>
 
 
</head>
<script language="vbscript">
Sub Window_onLoad
	intWidth = 600
	intHeight = 480
	Me.ResizeTo intWidth, intHeight
	Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
End Sub
 
Sub GetInfo
        run_button.disabled = True
        ComputerListFile.disabled = True
        Const ForReading = 1
        Const ForWriting = 2
        Set objFSO = CreateObject("Scripting.FileSystemObject")
 
        If ComputerListFile.Value <> "" Then
                If objFSO.FileExists(ComputerListFile.Value) = True Then
                        Set List = objFSO.OpenTextFile(ComputerListFile.Value, ForReading)
                        
                        strHTML = "<table width='40%' border=1 bgcolor='white'>" &_
                        "<th style='background:c0c0c0'><b>System</b></th><th style='background:c0c0c0'><b>Processor Type</b>"
                        Results.InnerHTML = strHTML
 			strHTML2 = "<table width='40%' border=1>" &_
                        "<th colspan='2' style='background:c0c0c0'><b>Number of Servers with:</b>"
			Totals.InnerHTML = strHTML2
 
			iArch1 = 0
			iArch2 = 0
			iArch3 = 0
			iArch4 = 0
			iArch5 = 0
			iArchU = 0
			iUnreach = 0
                        Do Until List.AtEndOfStream
                                strComputer = List.ReadLine
                                If Ping(strComputer) Then
                                        Set objWMIService = GetObject("winmgmts:" _
                                        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
                				    Set colProcessors = objWMIService.ExecQuery _
                				    ("Select * From Win32_Processor")
                                        For Each objProcessor in colProcessors
							strArch = "Arch Unknown"
							If objProcessor.Architecture = 0 Then strArch = "x86"
							If objProcessor.Architecture = 1 Then strArch = "MIPS"
							If objProcessor.Architecture = 2 Then strArch = "Alpha"
							If objProcessor.Architecture = 3 Then strArch = "PowerPC"
							If objProcessor.Architecture = 9 Then strArch = "x64"
                                        Next
                                        strHTML =  strHTML &"<tr><td width='40%' border=1>" & strComputer &_
                                        	"</td><td bgcolor='green'><font color='white'>" &strArch & "</font><br>"
					If strArch = "x86" then
						iArch1=iArch1+1
					Elseif strArch = "MIPS" then
						iArch2=iArch2+1
					Elseif strArch = "Alpha" then
						iArch3=iArch3+1
					Elseif strArch = "PowerPC" then
						iArch4=iArch4+1
					Elseif strArch = "x64" then
						iArch5=iArch5+1
					Else
						iArchU=iArchU+1
					End If
                                Else
					iUnreach = iUnreach + 1
                                        strHTML =  strHTML &"<tr><td width='40%'>"& strComputer & "</td><td bgcolor='red'><font color='white'>Unreachable</font></td></tr><br>"
                                End If
                        Loop
			strHTML2 =  strHTML2 &"<tr><td width='80%' border=1>x86"&_
                         	"</td><td>" &iArch1 & "<br>"&_
				"<tr><td width='80%' border=1>MIPS"&_
                         	"</td><td>" &iArch2 & "<br>"&_
				"<tr><td width='80%' border=1>Alpha"&_
                         	"</td><td>" &iArch3 & "<br>"&_
				"<tr><td width='80%' border=1>PowerPC"&_
                         	"</td><td>" &iArch4 & "<br>"&_
				"<tr><td width='80%' border=1>x64"&_
                         	"</td><td>" &iArch5 & "<br>"&_
				"<tr><td width='80%' border=1>Unknown"&_
                         	"</td><td>" &iArchU & "<br>"&_
				"<tr><td width='80%' border=1>Unreachable"&_
                         	"</td><td>" &iUnreach & "<br>"&_
                        List.Close      
                        Totals.InnerHTML = strHTML2 &"</table>"
                        Results.InnerHTML =  strHTML &"</table>"
                Else
                        MsgBox "File does not exist: " & ComputerListFile.Value
                End If
        Else
                MsgBox "Please specify a file name."
        End If
        run_button.disabled = False
        ComputerListFile.disabled = False
 
End Sub
        
Function Ping(strComputer)
        Dim objShell, boolCode
        Set objShell = CreateObject("WScript.Shell")
        boolCode = objShell.Run("Ping -n 1 -w 300 " & strComputer, 0, True)
        If boolCode = 0 Then
                Ping = True
        Else
                Ping = False
        End If
End Function
 
</script>
 
<body>
<input type="button" value="Run Script" name="run_button" onClick="GetInfo">
<input type="file" name="ComputerListFile"> <br><br>
<span id = "Totals"></span><br><br>
<span id = "Results"></span>
</body>
</html>
 
 
' end of hta 1
 
 
 
 
'============================================================ hta2 (service pack):
 
<head>
<title>Enumerate Service Pack on Remote Computers</title>
<HTA:APPLICATION 
     APPLICATIONNAME="Enumerate Service Pack on Remote Computers"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
<style type="text/css">
 
html {
font-family:arial;
font-size:smaller;
 
}
 
table {
border-collapse:collapse;
border:solid 1px black;
font-family:arial;
font-size:0.8em;
}
 
tr, td, th {
border-collapse:collapse;
border-style:solid;
}
 
td { border-width: 1px; }
 
 
</style>
 
 
</head>
<script language="vbscript">
Sub Window_onLoad
        intWidth = 600
        intHeight = 480
        Me.ResizeTo intWidth, intHeight
    Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
End Sub
 
Sub GetServicePack
        run_button.disabled = True
        ComputerListFile.disabled = True
        Const ForReading = 1
        Const ForWriting = 2
        Set objFSO = CreateObject("Scripting.FileSystemObject")
 
        If ComputerListFile.Value <> "" Then
                If objFSO.FileExists(ComputerListFile.Value) = True Then
                        Set List = objFSO.OpenTextFile(ComputerListFile.Value, ForReading)
                        
                        strHTML = "<table width='40%' border=1 bgcolor='white'>" &_
                        "<th style='background:c0c0c0'><b>System</b></th><th style='background:c0c0c0'><b>Service Pack</b>"
                        Results.InnerHTML = strHTML
 			strHTML2 = "<table width='40%' border=1>" &_
                        "<th colspan='2' style='background:c0c0c0'><b>Number of Servers with:</b>"
			Totals.InnerHTML = strHTML2
			iSpack1 = 0
			iSpack2 = 0
			iSpackU = 0
			iUnreach = 0
                        Do Until List.AtEndOfStream
                                strComputer = List.ReadLine
                                If Ping(strComputer) Then
 
                                        Set objWMIService = GetObject("winmgmts:" _
                                        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
                                        Set colSpack = objWMIService.ExecQuery _
                                        ("Select * from Win32_OperatingSystem")
                                        For Each objSpack in colSpack
                                                strSpack = objSpack.ServicePackMajorVersion
                                        Next
 
                                        strHTML =  strHTML &"<tr><td width='40%' border=1>" & strComputer &_
                                        	"</td><td bgcolor='green'><font color='white'>" &strSpack & "</font><br>"
                                	If strSpack = "1" then
						iSpack1=iSpack1+1
					Elseif strSpack = "2" then
						iSpack2=iSpack2+1
					Else
						iSpackU=iSpackU+1
					End If
                                Else
					iUnreach = iUnreach + 1
                                        strHTML =  strHTML &"<tr><td width='40%'>"& strComputer & "</td><td bgcolor='red'><font color='white'>Unreachable</font></td></tr><br>"
                                End If
                        Loop
			strHTML2 =  strHTML2 &"<tr><td width='80%' border=1>Service Pack 1"&_
                         	"</td><td>" &iSpack1 & "<br>"&_
				"<tr><td width='80%' border=1>Service Pack 2"&_
                         	"</td><td>" &iSpack2 & "<br>"&_
				"<tr><td width='80%' border=1>Unknown"&_
                         	"</td><td>" &iSpackU & "<br>"&_
				"<tr><td width='80%' border=1>Unreachable"&_
                         	"</td><td>" &iUnreach & "<br>"&_
                        List.Close      
                        Totals.InnerHTML = strHTML2 &"</table>"
                        Results.InnerHTML =  strHTML &"</table>"
                Else
                        MsgBox "File does not exist: " & ComputerListFile.Value
                End If
        Else
                MsgBox "Please specify a file name."
        End If
        run_button.disabled = False
        ComputerListFile.disabled = False
 
End Sub
        
Function Ping(strComputer)
        Dim objShell, boolCode
        Set objShell = CreateObject("WScript.Shell")
        boolCode = objShell.Run("Ping -n 1 -w 300 " & strComputer, 0, True)
        If boolCode = 0 Then
                Ping = True
        Else
                Ping = False
        End If
End Function
 
</script>
 
<body>
<input type="button" value="Get Service Pack" name="run_button" onClick="GetServicePack">
<input type="file" name="ComputerListFile"> <br><br>
<span id = "Totals"></span><br><br>
<span id = "Results"></span>
</body>
</html>

Open in new window

request.jpg
0
Comment
Question by:Simon336697
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 10

Expert Comment

by:TakedaT
ID: 24332854
Here you go.
<head>
<title>Enumerate System Information on Remote Computers</title>
<HTA:APPLICATION 
     APPLICATIONNAME="Enumerate System Information"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
<style type="text/css">
 
html {
font-family:arial;
font-size:smaller;
 
}
 
table {
border-collapse:collapse;
border:solid 1px black;
font-family:arial;
font-size:0.8em;
}
 
tr, td, th {
border-collapse:collapse;
border-style:solid;
}
 
td { border-width: 1px; }
 
 
</style>
 
 
</head>
<script language="vbscript">
Sub Window_onLoad
	intWidth = 600
	intHeight = 480
	Me.ResizeTo intWidth, intHeight
	Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
End Sub
 
Sub GetInfo
run_button.disabled = True
ComputerListFile.disabled = True
Const ForReading = 1
Const ForWriting = 2
SPacks.InnerHTML = "" : Archs.InnerHTML = "" : Totals.InnerHTML = ""
iArch1 = 0 : iArch2 = 0 : iArch3 = 0 : iArch4 = 0 : iArch5 = 0 : iArchU = 0
iSpack1 = 0 : iSpack2 = 0 : iSpackU = 0 : iUnreach = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
If ServicePack.Checked=True or Architecture.Checked=True then 
        If ComputerListFile.Value <> "" Then
                If objFSO.FileExists(ComputerListFile.Value) = True Then
                        Set List = objFSO.OpenTextFile(ComputerListFile.Value, ForReading)
             
  			strTotalHTML = "<table width='40%' border=1 bgcolor='white'>" &_
                        "<th style='background:c0c0c0'><b>System</b></th>"
 
                        If ServicePack.Checked=True then
				strSPHTML = "<table width='40%' border=1>" &_
				"<th colspan='2' style='background:c0c0c0'><b>Number of Servers with:</b>"
				SPacks.InnerHTML = strSPHTML
				strTotalHTML = strTotalHTML&"<th style='background:c0c0c0'><b>Service Pack</b>"
			End If
                        If Architecture.Checked=True then
				strArchHTML = "<table width='40%' border=1>" &_
				"<th colspan='2' style='background:c0c0c0'><b>Number of Servers with:</b>"
				Archs.InnerHTML = strArchHTML
				strTotalHTML = strTotalHTML&"<th style='background:c0c0c0'><b>Processor Type</b>"
			End If
			Totals.InnerHTML = strTotalHTML&"</tr>"
                        Do Until List.AtEndOfStream
				strComputer = List.ReadLine
				strTotalHTML = strTotalHTML &"<tr><td width='40%' border=1>" & strComputer &"</td>"
                                If Ping(strComputer) Then
					Set objWMIService = GetObject("winmgmts:" _
	                                        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 
                                        If ServicePack.Checked = True then
	                                        Set colSpack = objWMIService.ExecQuery _
	                                        ("Select * from Win32_OperatingSystem")
	                                        For Each objSpack in colSpack
	                                                strSpack = objSpack.ServicePackMajorVersion
	                                        Next
	                                	If strSpack = "1" then
							iSpack1=iSpack1+1
						Elseif strSpack = "2" then
							iSpack2=iSpack2+1
						Else
							iSpackU=iSpackU+1
						End If
	                                        strTotalHTML = strTotalHTML &"<td bgcolor='green'><font color='white'>" &strSpack & "</font><br>"
 
					End If
					If Architecture.Checked=True then
	                			Set colProcessors = objWMIService.ExecQuery _
	                			("Select * From Win32_Processor")
	                                        For Each objProcessor in colProcessors
							If objProcessor.Architecture = 0 Then
								iArch1=iArch1+1
								strArch = "x86"
							Elseif objProcessor.Architecture = 1 Then
								iArch2=iArch2+1
								strArch = "MIPS"
							Elseif objProcessor.Architecture = 2 Then
								iArch3=iArch3+1
								strArch = "Alpha"
							Elseif objProcessor.Architecture = 3 Then
								iArch4=iArch4+1
								strArch = "PowerPC"
							Elseif objProcessor.Architecture = 9 Then
								iArch5=iArch5+1
								strArch = "x64"
							Else
								iArchU=iArchU+1
								strArch = "Arch Unknown"
							End If
	                                        Next
 						strTotalHTML =  strTotalHTML &"<td bgcolor='green'><font color='white'>" &strArch & "</font><br>"
					End If
                                Else
					iUnreach = iUnreach + 1
					If ServicePack.Checked = True then
						strTotalHTML = strTotalHTML &"<td bgcolor='red'><font color='white'>Unreachable</font></td>"
					End If
					If Architecture.Checked=True then
						strTotalHTML = strTotalHTML &"<td bgcolor='red'><font color='white'>Unreachable</font></td>"
					End If
				End If
 
 
                        Loop
 
			If ServicePack.Checked = True then
				strSPHTML =  strSPHTML &"<tr><td width='80%' border=1>Service Pack 1"&_
	                 	"</td><td>" &iSpack1 & "<br>"&_
				"<tr><td width='80%' border=1>Service Pack 2"&_
	                 	"</td><td>" &iSpack2 & "<br>"&_
				"<tr><td width='80%' border=1>Unknown"&_
	                 	"</td><td>" &iSpackU & "<br>"&_
				"<tr><td width='80%' border=1>Unreachable"&_
	                 	"</td><td>" &iUnreach & "<br></table>"
				SPacks.InnerHTML = strSPHTML
			End If
			If Architecture.Checked=True then
				strArchHTML =  strArchHTML &"<tr><td width='80%' border=1>x86"&_
				"</td><td>" &iArch1 & "<br>"&_
				"<tr><td width='80%' border=1>MIPS"&_
				"</td><td>" &iArch2 & "<br>"&_
				"<tr><td width='80%' border=1>Alpha"&_
				"</td><td>" &iArch3 & "<br>"&_
				"<tr><td width='80%' border=1>PowerPC"&_
				"</td><td>" &iArch4 & "<br>"&_
				"<tr><td width='80%' border=1>x64"&_
				"</td><td>" &iArch5 & "<br>"&_
				"<tr><td width='80%' border=1>Unknown"&_
				"</td><td>" &iArchU & "<br>"&_
				"<tr><td width='80%' border=1>Unreachable"&_
				"</td><td>" &iUnreach & "<br></table>"
				Archs.InnerHTML = strArchHTML
			End If
			Totals.InnerHTML = strTotalHTML
			List.Close      
                Else
                        MsgBox "File does not exist: " & ComputerListFile.Value
                End If
		run_button.disabled = False
		ComputerListFile.disabled = False
        Else
                MsgBox "Please specify a file name."
        End If
        run_button.disabled = False
        ComputerListFile.disabled = False
Else
	MsgBox "You must pick at least 1 option."
End If
run_button.disabled = False
ComputerListFile.disabled = False
End Sub
        
Function Ping(strComputer)
        Dim objShell, boolCode
        Set objShell = CreateObject("WScript.Shell")
        boolCode = objShell.Run("Ping -n 1 -w 300 " & strComputer, 0, True)
        If boolCode = 0 Then
                Ping = True
        Else
                Ping = False
        End If
End Function
 
</script>
 
<body>
<input type="button" value="Run Script" name="run_button" onClick="GetInfo">
<input type="file" name="ComputerListFile" value="servers.txt"><br><br>
Inventory this information:<br><br>
<input type="checkbox" name="ServicePack">Service Pack<br><br>
<input type="checkbox" name="Architecture">Architecture<br><br>
<span id = "Spacks"></span><br>
<span id = "Archs"></span><br>
<span id = "Totals"></span><br><br>
</body>
</html>
 
 

Open in new window

0
 
LVL 1

Author Comment

by:Simon336697
ID: 24333021
TakedaT,
Youve done it yet again.
Im going to really understand what you have done, and hopefully learn a great deal from a guru in you :>)
Thanks so much mate.
0
 
LVL 1

Author Comment

by:Simon336697
ID: 24333040
Tak,
Just one thing if that is ok mate.
It doesnt look like your great script is summing the totals correctly for the architecture?
Eg. for whether the system is an x86, x64 etc.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:TakedaT
ID: 24335363
Could you show me a screen shot as an example?  I dont have the environment to test properly.
0
 
LVL 1

Author Comment

by:Simon336697
ID: 24342116
Hi Tak,
Here is a screenshot mate. Thanks so much again for your great help :>)
requests.jpg
0
 
LVL 10

Accepted Solution

by:
TakedaT earned 2000 total points
ID: 24349022
Sorry about that.  I think I fixed it.  Give it a go again.
<head>
<title>Enumerate System Information on Remote Computers</title>
<HTA:APPLICATION 
     APPLICATIONNAME="Enumerate System Information"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
<style type="text/css">
 
html {
font-family:arial;
font-size:smaller;
 
}
 
table {
border-collapse:collapse;
border:solid 1px black;
font-family:arial;
font-size:0.8em;
}
 
tr, td, th {
border-collapse:collapse;
border-style:solid;
}
 
td { border-width: 1px; }
 
 
</style>
 
 
</head>
<script language="vbscript">
Sub Window_onLoad
	intWidth = 600
	intHeight = 480
	Me.ResizeTo intWidth, intHeight
	Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
End Sub
 
Sub GetInfo
run_button.disabled = True
ComputerListFile.disabled = True
Const ForReading = 1
Const ForWriting = 2
SPacks.InnerHTML = "" : Archs.InnerHTML = "" : Totals.InnerHTML = ""
iArch1 = 0 : iArch2 = 0 : iArch3 = 0 : iArch4 = 0 : iArch5 = 0 : iArchU = 0
iSpack1 = 0 : iSpack2 = 0 : iSpackU = 0 : iUnreach = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
If ServicePack.Checked=True or Architecture.Checked=True then 
        If ComputerListFile.Value <> "" Then
                If objFSO.FileExists(ComputerListFile.Value) = True Then
                        Set List = objFSO.OpenTextFile(ComputerListFile.Value, ForReading)
             
  			strTotalHTML = "<table width='40%' border=1 bgcolor='white'>" &_
                        "<th style='background:c0c0c0'><b>System</b></th>"
 
                        If ServicePack.Checked=True then
				strSPHTML = "<table width='40%' border=1>" &_
				"<th colspan='2' style='background:c0c0c0'><b>Number of Servers with:</b>"
				SPacks.InnerHTML = strSPHTML
				strTotalHTML = strTotalHTML&"<th style='background:c0c0c0'><b>Service Pack</b>"
			End If
                        If Architecture.Checked=True then
				strArchHTML = "<table width='40%' border=1>" &_
				"<th colspan='2' style='background:c0c0c0'><b>Number of Servers with:</b>"
				Archs.InnerHTML = strArchHTML
				strTotalHTML = strTotalHTML&"<th style='background:c0c0c0'><b>Processor Type</b>"
			End If
			Totals.InnerHTML = strTotalHTML&"</tr>"
                        Do Until List.AtEndOfStream
				strComputer = List.ReadLine
				strTotalHTML = strTotalHTML &"<tr><td width='40%' border=1>" & strComputer &"</td>"
                                If Ping(strComputer) Then
					Set objWMIService = GetObject("winmgmts:" _
	                                        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 
                                        If ServicePack.Checked = True then
	                                        Set colSpack = objWMIService.ExecQuery _
	                                        ("Select * from Win32_OperatingSystem")
	                                        For Each objSpack in colSpack
	                                                strSpack = objSpack.ServicePackMajorVersion
	                                        Next
	                                	If strSpack = "1" then
							iSpack1=iSpack1+1
						Elseif strSpack = "2" then
							iSpack2=iSpack2+1
						Else
							iSpackU=iSpackU+1
						End If
	                                        strTotalHTML = strTotalHTML &"<td bgcolor='green'><font color='white'>" &strSpack & "</font><br>"
 
					End If
					If Architecture.Checked=True then
	                			Set colProcessors = objWMIService.ExecQuery _
	                			("Select * From Win32_Processor")
	                                        For Each objProcessor in colProcessors
							If objProcessor.Architecture = 0 Then
								strArch = "x86"
							Elseif objProcessor.Architecture = 1 Then
								strArch = "MIPS"
							Elseif objProcessor.Architecture = 2 Then
								strArch = "Alpha"
							Elseif objProcessor.Architecture = 3 Then
								strArch = "PowerPC"
							Elseif objProcessor.Architecture = 9 Then
								strArch = "x64"
							Else
								strArch = "Arch Unknown"
							End If
	                                        Next
						If strArch = "x86" then
							iArch1=iArch1+1
						Elseif strArch = "MIPS" then
							iArch2=iArch2+1
						Elseif strArch = "Alpha" then
							iArch3=iArch3+1
						Elseif strArch = "PowerPC" then
							iArch4=iArch4+1
						Elseif strArch = "x64" then
							iArch5=iArch5+1
						Else
							iArchU=iArchU+1
						End If
 						strTotalHTML =  strTotalHTML &"<td bgcolor='green'><font color='white'>" &strArch & "</font><br>"
					End If
                                Else
					iUnreach = iUnreach + 1
					If ServicePack.Checked = True then
						strTotalHTML = strTotalHTML &"<td bgcolor='red'><font color='white'>Unreachable</font></td>"
					End If
					If Architecture.Checked=True then
						strTotalHTML = strTotalHTML &"<td bgcolor='red'><font color='white'>Unreachable</font></td>"
					End If
				End If
 
 
                        Loop
 
			If ServicePack.Checked = True then
				strSPHTML =  strSPHTML &"<tr><td width='80%' border=1>Service Pack 1"&_
	                 	"</td><td>" &iSpack1 & "<br>"&_
				"<tr><td width='80%' border=1>Service Pack 2"&_
	                 	"</td><td>" &iSpack2 & "<br>"&_
				"<tr><td width='80%' border=1>Unknown"&_
	                 	"</td><td>" &iSpackU & "<br>"&_
				"<tr><td width='80%' border=1>Unreachable"&_
	                 	"</td><td>" &iUnreach & "<br></table>"
				SPacks.InnerHTML = strSPHTML
			End If
			If Architecture.Checked=True then
				strArchHTML =  strArchHTML &"<tr><td width='80%' border=1>x86"&_
				"</td><td>" &iArch1 & "<br>"&_
				"<tr><td width='80%' border=1>MIPS"&_
				"</td><td>" &iArch2 & "<br>"&_
				"<tr><td width='80%' border=1>Alpha"&_
				"</td><td>" &iArch3 & "<br>"&_
				"<tr><td width='80%' border=1>PowerPC"&_
				"</td><td>" &iArch4 & "<br>"&_
				"<tr><td width='80%' border=1>x64"&_
				"</td><td>" &iArch5 & "<br>"&_
				"<tr><td width='80%' border=1>Unknown"&_
				"</td><td>" &iArchU & "<br>"&_
				"<tr><td width='80%' border=1>Unreachable"&_
				"</td><td>" &iUnreach & "<br></table>"
				Archs.InnerHTML = strArchHTML
			End If
			Totals.InnerHTML = strTotalHTML
			List.Close      
                Else
                        MsgBox "File does not exist: " & ComputerListFile.Value
                End If
		run_button.disabled = False
		ComputerListFile.disabled = False
        Else
                MsgBox "Please specify a file name."
        End If
        run_button.disabled = False
        ComputerListFile.disabled = False
Else
	MsgBox "You must pick at least 1 option."
End If
run_button.disabled = False
ComputerListFile.disabled = False
End Sub
        
Function Ping(strComputer)
        Dim objShell, boolCode
        Set objShell = CreateObject("WScript.Shell")
        boolCode = objShell.Run("Ping -n 1 -w 300 " & strComputer, 0, True)
        If boolCode = 0 Then
                Ping = True
        Else
                Ping = False
        End If
End Function
 
</script>
 
<body>
<input type="button" value="Run Script" name="run_button" onClick="GetInfo">
<input type="file" name="ComputerListFile" value="servers.txt"><br><br>
Inventory this information:<br><br>
<input type="checkbox" name="ServicePack">Service Pack<br><br>
<input type="checkbox" name="Architecture">Architecture<br><br>
<span id = "Spacks"></span><br>
<span id = "Archs"></span><br>
<span id = "Totals"></span><br><br>
</body>
</html>
 
 

Open in new window

0
 
LVL 1

Author Comment

by:Simon336697
ID: 24350074
Tak, I cant thank you enough. You fixed it :>)
That is awesome Tak.
Take care.
Simon
0
 
LVL 1

Author Closing Comment

by:Simon336697
ID: 31579214
Brilliant Tak :>)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

618 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