Advertisement
rtpy1015

os_x86_64.vbs

Feb 10th, 2021
1,520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim ObjWMI, ColSettings, ObjProcessor
  2. Dim StrComputer, ObjNetwork
  3.  
  4. Set ObjNetwork = WScript.CreateObject("WScript.Network")
  5. StrComputer = Trim(ObjNetwork.ComputerName)
  6. Set ObjNetwork = Nothing
  7. WScript.Echo VbCrLf & "Computer Name: " & StrComputer
  8. WScript.Echo vbNullString
  9. Set ObjWMI = GetObject("WINMGMTS:" & "{ImpersonationLevel=Impersonate,AuthenticationLevel=Pkt}!\\" & StrComputer & "\Root\CIMV2")
  10. Set ColSettings = ObjWMI.ExecQuery ("SELECT * FROM Win32_Processor")
  11. For Each ObjProcessor In ColSettings
  12.     Select Case ObjProcessor.Architecture
  13.         Case 0
  14.             WScript.Echo "Processor Architecture Used by the Platform: x86"
  15.         Case 6
  16.             WScript.Echo "Processor Architecture Used by the Platform: Itanium-Based System"
  17.         Case 9
  18.             WScript.Echo "Processor Architecture Used by the Platform: x64"
  19.     End Select
  20.     Select Case ObjProcessor.ProcessorType
  21.         Case 1
  22.             WScript.Echo "Processor Type: Other. Not in the Known List"    
  23.         Case 2
  24.             WScript.Echo "Processor Type: Unknown Type"
  25.         Case 3
  26.             WScript.Echo "Processor Type: Central Processor (CPU)"
  27.         Case 4
  28.             WScript.Echo "Processor Type: Math Processor"
  29.         Case 5
  30.             WScript.Echo "Processor Type: DSP Processor"
  31.         Case 6
  32.             WScript.Echo "Processor Type: Video Processor"
  33.     End Select
  34.     WScript.Echo "Processor: " & ObjProcessor.DataWidth & "-Bit"
  35.     WScript.Echo "Operating System: " & ObjProcessor.AddressWidth & "-Bit"
  36.     WScript.Echo vbNullString    
  37.     If ObjProcessor.Architecture = 0 AND ObjProcessor.AddressWidth = 32 Then
  38.         WScript.Echo "This Machine has 32 Bit Processor and Running 32 Bit OS"
  39.     End If
  40.     If (ObjProcessor.Architecture = 6 OR ObjProcessor.Architecture = 9) AND ObjProcessor.DataWidth = 64 AND ObjProcessor.AddressWidth = 32 Then
  41.         WScript.Echo "This Machine has 64-Bit Processor and Running 32-Bit OS"
  42.     End If
  43.     If (ObjProcessor.Architecture = 6 OR ObjProcessor.Architecture = 9) AND ObjProcessor.DataWidth = 64 AND ObjProcessor.AddressWidth = 64 Then
  44.         WScript.Echo "This Machine has 64-Bit Processor and Running 64-Bit OS"
  45.     End If
  46. Next
  47. Set ObjProcessor = Nothing:    Set ColSettings = Nothing:    Set ObjWMI = Nothing:    StrComputer = vbNullstring
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement