HTA Script To Get A Prompted Machines Architecture Type

 

This Hta script will take a machine name from an input box and return the machines architecture type to the page.

 

HTA Script:

 

<html>

<head>

<title>Don Hite For myITforum</title>

<style>

body{width:120;height:160}

</style>

</head>

 

<script language="Vbscript">

Sub Window_OnLoad

RunSub

End Sub

 

Sub RunSub

Document.Body.BgColor="Wheat"

strComputer = InputBox ("Enter Machine name")

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_Processor")

For Each objItem in colItems

 

Select Case objItem.Architecture

Case 0 strArchitecture = "X86"

Case 1 strArchitecture = "MIPS"

Case 2 strArchitecture = "Alpha"

Case 3 strArchitecture = "PowerPC"

Case 6 strArchitecture = "Intel Itanium Processor Family (IPF)"

Case 9 strArchitecture = "x64"

End Select

 

DataArea.InnerHTML = "The Machine " & UCase(objItem.SystemName) & " Is A " &_

strArchitecture & " Architecture System"

Next

 

End Sub

</script>

 

<body>

<span id="DataArea"></span>

</body>

</html>

 

Published Friday, December 29, 2006 10:23 PM by dhite
Filed under:

Comments

No Comments