Help will empty field entry handling
- From: Daz <darren.blackley@xxxxxxxxx>
- Date: Sun, 18 May 2008 11:13:25 -0700 (PDT)
Hi all,
am using the following code to pull the motherboard serial number from
machines, however some 3rd party oem machines have an empty serial
number field and i would like to have the code report "no serial
number found" if the field is empty of null...
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2")
Set colItems = objWMIService.ExecQuery( "SELECT * FROM
Win32_BaseBoard",,48)
For Each objItem in colItems
If IsNull(objItem.SerialNumber) Then
MsgBox(objItem.SerialNumber)
End If
Next
and
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_BaseBoard",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_BaseBoard instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "SerialNumber: " & objItem.SerialNumber
Next
You help would be greatly appreciated.
Cheers,
Daz
.
- Follow-Ups:
- Re: Help will empty field entry handling
- From: Todd Vargo
- Re: Help will empty field entry handling
- Prev by Date: Re: Find Default Network Card NIC
- Next by Date: Re: Find Default Network Card NIC
- Previous by thread: Find Default Network Card NIC
- Next by thread: Re: Help will empty field entry handling
- Index(es):
Relevant Pages
|
|