Serial Number

K

keepITcool

and which serial number did you have in mind?
drive/networkcard etc...

following will give you serial of a drive

Function GetDriveSerial&(Drive$)
With CreateObject("Scripting.FileSystemObject")
On Error Resume Next
With .GetDrive(Drive)
Stop
If .IsReady Then
GetDriveSerial = Abs(.SerialNumber)
Else
GetDriveSerial = -1
End If
End With
On Error GoTo 0
End With
End Function

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Jason Zischke wrote :
 
L

lear

If you're looking for the PC's serial number, you can use WMI. You
need to have admin rights to run this though...

Sub serial()
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
For Each objBIOS In colSettings
MsgBox objBIOS.SerialNumber
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top