heng03
asked on
System info & Hardware Devices
Hi
I want to know, using VB, how to get below system info. & hardware device of each indivdual computer.
1) OS
eg, Microsoft Windows
2) Processor
eg, x86 Family 6 Model 11 Stepping 1
Speed: 1196 Mhz
3) Memory
eg, 256 MB Chip
4) Drive Information
eg, GENERIC IDE DISK TYPE47 - 18.63 GB
5) Adapter
eg,
Realtek 8139-series PCI NIC
Mac: 00:50:EB:08:86:B8
PPP Adapter.
Mac: 44:45:53:54:00:00
No MAC Address
6) HDD Partition info
eg, Drive ID etc
7) FDD Info (Drive ID)
8) Sound Card info
9) CD card Info
10) Display Video card info
11) others Hardward devices info
eg,
Keyboard, mouse, USB ports, COM Ports, Parallel port (Printer) etc
Thanks & Rgs
Heng
I want to know, using VB, how to get below system info. & hardware device of each indivdual computer.
1) OS
eg, Microsoft Windows
2) Processor
eg, x86 Family 6 Model 11 Stepping 1
Speed: 1196 Mhz
3) Memory
eg, 256 MB Chip
4) Drive Information
eg, GENERIC IDE DISK TYPE47 - 18.63 GB
5) Adapter
eg,
Realtek 8139-series PCI NIC
Mac: 00:50:EB:08:86:B8
PPP Adapter.
Mac: 44:45:53:54:00:00
No MAC Address
6) HDD Partition info
eg, Drive ID etc
7) FDD Info (Drive ID)
8) Sound Card info
9) CD card Info
10) Display Video card info
11) others Hardward devices info
eg,
Keyboard, mouse, USB ports, COM Ports, Parallel port (Printer) etc
Thanks & Rgs
Heng
You will have to use WMI. See if this article helps.
http://archive.devx.com/upload/free/features/vbpj/2000/09sep00/kg0009/kg0009-1.asp
http://archive.devx.com/upload/free/features/vbpj/2000/09sep00/kg0009/kg0009-1.asp
Go here and Download System Scripting Runtime 1.4 (if you havent already got it)
http://www.netal.com/download.htm
and use this VBScript...
Option Explicit
On Error Resume Next
Dim objIPNetwork
Dim objLMNetwork
Dim objSystem
Dim strSystemInfo
Dim strProductType
'Clear any previous errors
Err.Clear
'Create object reference for the ping operation
Set objIPNetwork = CreateObject("SScripting.I PNetwork")
'Create object reference for the ping operation
Set objLMNetwork = CreateObject("SScripting.L MNetwork")
'Create object reference for the ping operation
Set objSystem = CreateObject("SScripting.S ystem")
If Err.Number <> 0 Then
Wscript.Echo "An error occurred creating an object reference." & _
vbCrLf & "Please register the SScrRun.dll file."
Wscript.Quit
End If
'Determine the operating system product type
Select Case objSystem.ProductType
Case -1 : strProductType = "unknown"
Case 0 : strProductType = "workstation"
Case 1 : strProductType = "server"
Case 2 : strProductType = "domain controller"
End Select
strSystemInfo = "------------------------- ---------- -------" & vbCrLf & _
"System Information" & vbCrLf & _
"------------------------- ---------- -------" & vbCrLf & _
"Computer Name: " & objLMNetwork.ComputerName & vbCrLf & _
"Host Name: " & objIPNetwork.HostName & vbCrLf & _
"DNS Domain Name: " & objIPNetwork.Domain & vbCrLf & _
"Current Directory: " & objSystem.CurrentDirectory & vbCrLf & _
"System Directory: " & objSystem.SystemDirectory & vbCrLf & _
"Windows Directory: " & objSystem.WindowsDirectory & vbCrLf & _
"Temp Path: " & objSystem.TempPath & vbCrLf & _
"Operating System: " & objSystem.OperatingSystem & vbCrLf & _
"Processor Count: " & objSystem.ProcessorCount & vbCrLf & _
"Processor Description: " & objSystem.ProcessorDescrip tion & vbCrLf & _
"Product Type: " & strProductType & vbCrLf & _
"User Name: " & objSystem.UserName & vbCrLf & _
"Total Memory: " & objSystem.TotalMemory & "MB" & vbCrLf & _
"Local Time: " & objSystem.GetLocalTime() & vbCrLf & _
"System Time: " & objSystem.GetSystemTime() & vbCrLf & _
"------------------------- ---------- -------"
'Display letter, type, total space and free space about every available Drive
Dim strDriveInfo, strDrive, intDriveType, intCounter, strDriveType
Dim strTDiskSpace, strFDiskSpace
strDriveInfo = "Drive Information" & vbCrLf & _
"------------------------- ---------- -------"
'Loop through 26 possible drive letters
For intCounter = 0 to 25
strDrive = chr( 65 + intCounter ) & ":"
intDriveType = objSystem.GetDriveType( strDrive )
If intDriveType <> 1 Then
'Drive exists
'Determine drive type
Select Case intDriveType
Case 0 'The drive type cannot be determined.
strDriveType = "unknown"
Case 1 'The specified drive does not exist.
strDriveType = "does not exist"
Case 2 'The disk can be removed from the drive.
strDriveType = "removable"
Case 3 'The disk cannot be removed from the drive.
strDriveType = "fixed"
Case 4 'The drive is a remote (network) drive.
strDriveType = "network"
Case 5 'The drive is a CD-ROM drive.
strDriveType = "cd-rom"
Case 6 'The drive is a RAM disk.
strDriveType = "ram disk"
End Select
'Add appropriate info about drive depending on media availability.
If objSystem.GetTotalDiskSpac e( strDrive ) > 0 Then
strTDiskSpace = CStr(objSystem.GetTotalDis kSpace( strDrive )) & " KB"
strFDiskSpace = CStr(objSystem.GetFreeDisk Space( strDrive )) & " KB"
Else
strTDiskSpace = "No media"
strFDiskSpace = "N/A"
End If
strDriveInfo = strDriveInfo & vbCrLf & _
"Drive " & strDrive & _
", Type: " & strDriveType & _
", TotalDiskSpace: " & strTDiskSpace & _
", FreeDiskSpace: " & strFDiskSpace
End If
Next
'Display system info message
WScript.Echo strSystemInfo & vbCrLf & strDriveInfo
'Release object references
Set objIPNetwork = Nothing
Set objLMNetwork = Nothing
Set objSystem = Nothing
gSet objSystem = Nothing
I am working on the rest of the info you need...
http://www.netal.com/download.htm
and use this VBScript...
Option Explicit
On Error Resume Next
Dim objIPNetwork
Dim objLMNetwork
Dim objSystem
Dim strSystemInfo
Dim strProductType
'Clear any previous errors
Err.Clear
'Create object reference for the ping operation
Set objIPNetwork = CreateObject("SScripting.I
'Create object reference for the ping operation
Set objLMNetwork = CreateObject("SScripting.L
'Create object reference for the ping operation
Set objSystem = CreateObject("SScripting.S
If Err.Number <> 0 Then
Wscript.Echo "An error occurred creating an object reference." & _
vbCrLf & "Please register the SScrRun.dll file."
Wscript.Quit
End If
'Determine the operating system product type
Select Case objSystem.ProductType
Case -1 : strProductType = "unknown"
Case 0 : strProductType = "workstation"
Case 1 : strProductType = "server"
Case 2 : strProductType = "domain controller"
End Select
strSystemInfo = "-------------------------
"System Information" & vbCrLf & _
"-------------------------
"Computer Name: " & objLMNetwork.ComputerName & vbCrLf & _
"Host Name: " & objIPNetwork.HostName & vbCrLf & _
"DNS Domain Name: " & objIPNetwork.Domain & vbCrLf & _
"Current Directory: " & objSystem.CurrentDirectory
"System Directory: " & objSystem.SystemDirectory & vbCrLf & _
"Windows Directory: " & objSystem.WindowsDirectory
"Temp Path: " & objSystem.TempPath & vbCrLf & _
"Operating System: " & objSystem.OperatingSystem & vbCrLf & _
"Processor Count: " & objSystem.ProcessorCount & vbCrLf & _
"Processor Description: " & objSystem.ProcessorDescrip
"Product Type: " & strProductType & vbCrLf & _
"User Name: " & objSystem.UserName & vbCrLf & _
"Total Memory: " & objSystem.TotalMemory & "MB" & vbCrLf & _
"Local Time: " & objSystem.GetLocalTime() & vbCrLf & _
"System Time: " & objSystem.GetSystemTime() & vbCrLf & _
"-------------------------
'Display letter, type, total space and free space about every available Drive
Dim strDriveInfo, strDrive, intDriveType, intCounter, strDriveType
Dim strTDiskSpace, strFDiskSpace
strDriveInfo = "Drive Information" & vbCrLf & _
"-------------------------
'Loop through 26 possible drive letters
For intCounter = 0 to 25
strDrive = chr( 65 + intCounter ) & ":"
intDriveType = objSystem.GetDriveType( strDrive )
If intDriveType <> 1 Then
'Drive exists
'Determine drive type
Select Case intDriveType
Case 0 'The drive type cannot be determined.
strDriveType = "unknown"
Case 1 'The specified drive does not exist.
strDriveType = "does not exist"
Case 2 'The disk can be removed from the drive.
strDriveType = "removable"
Case 3 'The disk cannot be removed from the drive.
strDriveType = "fixed"
Case 4 'The drive is a remote (network) drive.
strDriveType = "network"
Case 5 'The drive is a CD-ROM drive.
strDriveType = "cd-rom"
Case 6 'The drive is a RAM disk.
strDriveType = "ram disk"
End Select
'Add appropriate info about drive depending on media availability.
If objSystem.GetTotalDiskSpac
strTDiskSpace = CStr(objSystem.GetTotalDis
strFDiskSpace = CStr(objSystem.GetFreeDisk
Else
strTDiskSpace = "No media"
strFDiskSpace = "N/A"
End If
strDriveInfo = strDriveInfo & vbCrLf & _
"Drive " & strDrive & _
", Type: " & strDriveType & _
", TotalDiskSpace: " & strTDiskSpace & _
", FreeDiskSpace: " & strFDiskSpace
End If
Next
'Display system info message
WScript.Echo strSystemInfo & vbCrLf & strDriveInfo
'Release object references
Set objIPNetwork = Nothing
Set objLMNetwork = Nothing
Set objSystem = Nothing
gSet objSystem = Nothing
I am working on the rest of the info you need...
ASKER
Hi rhys
Waiting for the rest of your information.
Will give you extra 50 points (total 250) for the rest of the information.
Do you also know any example source code for using WMI ?
I installed WMI but where to check it ?
Thanks & Rgds
Heng
Waiting for the rest of your information.
Will give you extra 50 points (total 250) for the rest of the information.
Do you also know any example source code for using WMI ?
I installed WMI but where to check it ?
Thanks & Rgds
Heng
ASKER
Hi rhys
Waiting for the rest of your information.
Will give you extra 50 points (total 250) for the rest of the information.
Do you also know any example source code for using WMI ?
I installed WMI but where to check it ?
Thanks & Rgds
Heng
Waiting for the rest of your information.
Will give you extra 50 points (total 250) for the rest of the information.
Do you also know any example source code for using WMI ?
I installed WMI but where to check it ?
Thanks & Rgds
Heng
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yet another example of using WMI (this time with VB.Net)....
I've got an application called SOSOS that will gather 150+ pieces of information from a PC and store the results in a central database. It's useful for putting in a login batch... or can be remotely over the network by an Administrator.
Full source code is at ftp://ftp.dpw.hood.army.mil/programs/sosos
I've got an application called SOSOS that will gather 150+ pieces of information from a PC and store the results in a central database. It's useful for putting in a login batch... or can be remotely over the network by an Administrator.
Full source code is at ftp://ftp.dpw.hood.army.mil/programs/sosos
ASKER
Hi rhys
Thanks for your help. It is useful.
Also thanks to Graye.
Note : For Graye : I will create another Question & will allocate points to you for your help too.
Pls answer that question (answer dummy as your answer is here already).
Graye : Sorry for the trouble as here it is not allow to split (allocate) points to more than one experts in
a question's answer.
Thanks & Rgds
Heng
Thanks for your help. It is useful.
Also thanks to Graye.
Note : For Graye : I will create another Question & will allocate points to you for your help too.
Pls answer that question (answer dummy as your answer is here already).
Graye : Sorry for the trouble as here it is not allow to split (allocate) points to more than one experts in
a question's answer.
Thanks & Rgds
Heng
relax... this is not a competition with me. There's no need to do anything get me more points!
I'm just trying to help folks out
I'm just trying to help folks out
ASKER
Hi Graye
Thanks anyway.
I already posted a question for you.
Hope to see you there for it.
Rgds
Heng
Thanks anyway.
I already posted a question for you.
Hope to see you there for it.
Rgds
Heng
ASKER
Only answer meet with most of the requirements will get the points.
Else I will post another question for less points of the answer.
Thanks & Rgds
Heng