Created
February 15, 2015 15:55
-
-
Save kessler/175ce5d85303671168cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim ObjWMI, ColSettings, ObjProcessor | |
Dim StrComputer, ObjNetwork | |
Set ObjNetwork = WScript.CreateObject("WScript.Network") | |
StrComputer = Trim(ObjNetwork.ComputerName) | |
Set ObjNetwork = Nothing | |
WScript.Echo VbCrLf & "Computer Name: " & StrComputer | |
WScript.Echo vbNullString | |
Set ObjWMI = GetObject("WINMGMTS:" & "{ImpersonationLevel=Impersonate,AuthenticationLevel=Pkt}!\\" & StrComputer & "\Root\CIMV2") | |
Set ColSettings = ObjWMI.ExecQuery ("SELECT * FROM Win32_Processor") | |
For Each ObjProcessor In ColSettings | |
WScript.Echo "Processor: " & ObjProcessor.DataWidth & "-Bit" | |
WScript.Echo "Operating System: " & ObjProcessor.AddressWidth & "-Bit" | |
WScript.Echo vbNullString | |
If ObjProcessor.Architecture = 0 AND ObjProcessor.AddressWidth = 32 Then | |
WScript.Echo "This Machine has 32 Bit Processor and Running 32 Bit OS" | |
End If | |
If (ObjProcessor.Architecture = 6 OR ObjProcessor.Architecture = 9) AND ObjProcessor.DataWidth = 64 AND ObjProcessor.AddressWidth = 32 Then | |
WScript.Echo "This Machine has 64-Bit Processor and Running 32-Bit OS" | |
End If | |
If (ObjProcessor.Architecture = 6 OR ObjProcessor.Architecture = 9) AND ObjProcessor.DataWidth = 64 AND ObjProcessor.AddressWidth = 64 Then | |
WScript.Echo "This Machine has 64-Bit Processor and Running 64-Bit OS" | |
End If | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment