Rx_
Nothing In Moderation
- Local time
- Today, 00:51
- Joined
- Oct 22, 2009
- Messages
- 2,803
Code:
Public Function winVer()
On Error Resume Next
Dim strMessage As String
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem In colOperatingSystems
strMessage = objOperatingSystem.Caption & _
" " & objOperatingSystem.Version
Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor", , 48)
For Each objItem In colItems
strMessage = strMessage & " " & objItem.AddressWidth & " Bit"
Next
MsgBox strMessage
End Function