The-Coolest
asked on
How can I view the System Information using VB6?
Hiii guys,
How can I view the System Information using VB6?
for example I want to view the following:
- OS Type
- CPU Type and Speed
- RAM Speed + (number of slots used and free)---> this is not important but if it's possible it would be better
- HDD used and free space
- Motherboard type
- UserName logged in
- Sofwtare and Patches installed
I found some applications but most of them are not that accurate and don't have the information I need.
Thanks for your help and I'll be waiting for your reply.
How can I view the System Information using VB6?
for example I want to view the following:
- OS Type
- CPU Type and Speed
- RAM Speed + (number of slots used and free)---> this is not important but if it's possible it would be better
- HDD used and free space
- Motherboard type
- UserName logged in
- Sofwtare and Patches installed
I found some applications but most of them are not that accurate and don't have the information I need.
Thanks for your help and I'll be waiting for your reply.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for CPU on Win(2k/nt/xp):
http://www.devx.com/vb2themax/Tip/18373
some other links:
http://vbnet.mvps.org/code/wmi/
http://www.vbcode.com/Asp/showsn.asp?theID=11653
http://vbnet.mvps.org/index.html?code/wmi/win32_processor.htm
http://www.devx.com/vb2themax/Tip/18373
some other links:
http://vbnet.mvps.org/code/wmi/
http://www.vbcode.com/Asp/showsn.asp?theID=11653
http://vbnet.mvps.org/index.html?code/wmi/win32_processor.htm
Here is an extremely good example , go here :
http://vbturk.net/idsorgula.asp?id=781
Copy and paste that visual basic code into a new project and make sure you put a combobox and a listview into the project, to add a listview right click on the toolbar and click add component, scroll down until you get to "microsoft windows common controls" add the sp6 or one of the latest versions of them controls in by checking the box and clicking on ok, also go to project --> references and make sure that wmi scripting V1.2 is checked and also that microsoft scripting runtime is checked.
http://vbturk.net/idsorgula.asp?id=781
Copy and paste that visual basic code into a new project and make sure you put a combobox and a listview into the project, to add a listview right click on the toolbar and click add component, scroll down until you get to "microsoft windows common controls" add the sp6 or one of the latest versions of them controls in by checking the box and clicking on ok, also go to project --> references and make sure that wmi scripting V1.2 is checked and also that microsoft scripting runtime is checked.
wth that example you are basically using the combo box to select the wmi classes and then it enumerates the info into the list view :)
If you cant figure it out let me know and I can upload the one I made using that example from that site.
Go here for the example :
http://www.geocities.com/gecko_au2003/system.htm
I had to zip it up but its in there :)
Obviously you will need to take out figure out which classes you want to use by going through them and seeing which info it returns and deciding which ones are relevant to you, once you establish that you can either post back and let me know which classes return the info you want and I can help you put together a completed vb 6 app to do it.
If you would like ?
http://www.geocities.com/gecko_au2003/system.htm
I had to zip it up but its in there :)
Obviously you will need to take out figure out which classes you want to use by going through them and seeing which info it returns and deciding which ones are relevant to you, once you establish that you can either post back and let me know which classes return the info you want and I can help you put together a completed vb 6 app to do it.
If you would like ?
Just as an FYI - that vb app I knocked together from that site I gave you is missing a few classes such as this one :
Win32_OperatingSystem
You can view examples on how to do things with that class and other ones by going here, I already referenced this site above :)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__computer_hardware.asp
Win32_OperatingSystem
You can view examples on how to do things with that class and other ones by going here, I already referenced this site above :)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__computer_hardware.asp
If you notice any classes missing from that vb app literally just add a line like so to the form load event :
Combo1.AddItem "Win32_OperatingSystem"
So for the Win32_OperatingSystem class I just added the above line in the form load event, just do the same for any other classes that you notice are missing.
Combo1.AddItem "Win32_OperatingSystem"
So for the Win32_OperatingSystem class I just added the above line in the form load event, just do the same for any other classes that you notice are missing.
Hi,
@The-Coolest: ... by the way, what's wrong, with the provided "WMI Demo - CPU Information" source code? It's infact giving you:
sInfoString = "Description: " & .Description & vbCrLf
sInfoString = sInfoString & "Processor ID: " & .ProcessorID & vbCrLf
sInfoString = sInfoString & "Status: " & .Status & vbCrLf
sInfoString = sInfoString & "Manufacturer: " & .Manufacturer & vbCrLf
sInfoString = sInfoString & "Availability: " & AvailabilityToString(.Avai lability) & vbCrLf
sInfoString = sInfoString & "Load Percentage: " & .LoadPercentage & vbCrLf
sInfoString = sInfoString & "Current Clock Speed: " & .CurrentClockSpeed & " MHz" & vbCrLf
sInfoString = sInfoString & "Maximum Clock Speed: " & .MaxClockSpeed & vbCrLf
sInfoString = sInfoString & "Level 2 Cache Size: " & .L2CacheSize & vbCrLf
sInfoString = sInfoString & "Level 2 Cache Speed: " & .L2CacheSpeed & vbCrLf
sInfoString = sInfoString & "Power Management Supported: " & .PowerManagementSupported
Best regards,
Raisor
@The-Coolest: ... by the way, what's wrong, with the provided "WMI Demo - CPU Information" source code? It's infact giving you:
sInfoString = "Description: " & .Description & vbCrLf
sInfoString = sInfoString & "Processor ID: " & .ProcessorID & vbCrLf
sInfoString = sInfoString & "Status: " & .Status & vbCrLf
sInfoString = sInfoString & "Manufacturer: " & .Manufacturer & vbCrLf
sInfoString = sInfoString & "Availability: " & AvailabilityToString(.Avai
sInfoString = sInfoString & "Load Percentage: " & .LoadPercentage & vbCrLf
sInfoString = sInfoString & "Current Clock Speed: " & .CurrentClockSpeed & " MHz" & vbCrLf
sInfoString = sInfoString & "Maximum Clock Speed: " & .MaxClockSpeed & vbCrLf
sInfoString = sInfoString & "Level 2 Cache Size: " & .L2CacheSize & vbCrLf
sInfoString = sInfoString & "Level 2 Cache Speed: " & .L2CacheSpeed & vbCrLf
sInfoString = sInfoString & "Power Management Supported: " & .PowerManagementSupported
Best regards,
Raisor
ASKER