+ Reply to Thread
Results 1 to 5 of 5

Serial Number

  1. #1
    Jason Zischke
    Guest

    Serial Number

    Is there a way for Visual Basic to record you computer's serial number?

  2. #2
    keepITcool
    Guest

    Re: Serial Number

    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 :

    > Is there a way for Visual Basic to record you computer's serial
    > number?


  3. #3
    keepITcool
    Guest

    Re: Serial Number

    PS: the line with stop can be removed

  4. #4
    lear
    Guest

    Re: Serial Number

    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


  5. #5
    Bill Schanks
    Guest

    Re: Serial Number

    FYI ... This worked for me and I DON'T have admin rights on my work PC.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1