Getting the hard drive serial number

 Function HdNum() As String

    Dim fsObj   As Object

    Dim drv     As Object

    Set fsObj = CreateObject("Scripting.FileSystemObject")

    Set drv = fsObj.Drives("C")

    HdNum = Hex(drv.serialnumber)

End Function

Sub HD()

    MsgBox HdNum

End Sub

 

Since each computers hdd serial number is unique this can be useful for security