Question: I am writing an application in Visual Basic that pulls basic information about the computer and outputs the data onto a form. Currently, I am trying to pull the serial number for the machine I would be using. For example, pulling a serial number of a laptop from the BIOS. I have looked around the internet and haven't really found how to do this in Visual Basic without using WMI or C. Is there a way to do this in Visual Basic?

Below is what I have currently in the form, so you can get an idea of what I am trying to do:

```
        TextBoxComputerName.Text = Environment.MachineName
        TextBoxOSVersion.Text = System.Environment.OSVersion.ToString
        TextBoxOSFullName.Text = My.Computer.Info.OSFullName
        TextBoxCurrentUser.Text = System.Environment.UserName
        TextBox64Bit.Text = System.Environment.Is64BitOperatingSystem
        TextBoxSystemDirectory.Text = System.Environment.SystemDirectory
        TextBoxDomain.Text = System.Environment.UserDomainName
        ' CHECK SERIAL NUMBER HERE.

```

Thank you all so much!

Answer: 
This is VBScript but should be pastable into VB6.

You do know this field is blank on many computers?

```
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_BIOS")

For Each objItem in colItems
    msgbox objItem.SerialNumber
Next

```

From a command prompt (but I don't think home editions get the console program wmic)

```
wmic bios get /format:list

```

or

```
wmic bios get serialnumber /format:list

```
I found a way to get to this a bit backwards in VBA, using the `FileSystemObject`. You will need to set a reference to the Windows Scripting Runtime.

```
Option Explicit

Public Sub GetHDSerial()

    Dim objFSO          As FileSystemObject
    Dim objFolder       As Folder

    Dim strComputer     As String

    strComputer = "myComputer"
    Set objFSO = New FileSystemObject
    Set objFolder = objFSO.GetFolder("\\" & strComputer & "\c$")
    Debug.Print Hex(objFolder.Drive.SerialNumber)

    Set objFSO = Nothing
    Set objFolder = Nothing

End Sub

```

This does not account for multiple physical drives, which wasn't a problem in my environment.