Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting BIOS Info 1

Status
Not open for further replies.

Bitaoo

Programmer
Dec 18, 2002
81
US
Hello,

I have a problem, I wrote this code for getting BIOS information but it is not working on Win 98, Do you have any idea why it doesn't work?

Function Get_BIOSSerialNum() As String
Dim strComputer As String, S As String
Dim objWMIService As Object, colItems As Object, objItem As Object

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS", , 48)
For Each objItem In colItems
Get_BIOSSerialNum = Get_BIOSSerialNum & objItem.SerialNumber
Next
End Function

I got the following error in this line <Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")>

Run-Time Error 432: File name or class name not found during automation operation

Thanks a lot for your help.
--Bita
 
Is this in the IDE or a compiled .exe? If it's in IDE then see:


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
>Do you have any idea why it doesn't work?

Primarily because the WMI support built in to W98 is pretty limited. It only really started getting interesting with the WMI 1.5 stuff in W2000.

This can be addressed by going here:
Furthermore, as I recall, WMI does not start automatically on W98, nor can it be invoked remotely unless a) it is already running on the remote W98 machine; and b) DCOM is configured correctly <fx: google>

Try the following:
and

 
Thanks for all of your responses, but how can I write a better code to get BIOS Serial Number in Win 98 without any problem.

I appreciate your help in advance,
--Bita
 
Um...the three links I posted should provide enough information to fix your WMI issues on W98. It is worth pointing out, by the way, that:

a) BIOS serial numbers are by no means unqiue
b) BIOS serial numbers may not even be set (e.g. on my motherboard, the BIOS serial number unset, which WMI reads as "xxxxxxxxxxx")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top