Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Pendrive Serial Number Using VB6 1

Status
Not open for further replies.

plopez

Technical User
Apr 2, 2002
66
CL
Hi,

I need to know how can I get the Pendrive serial number using VB6 Code...

Thanks for your help.
 
I don't know if this will work for a pen drive, but it certainly works for local hard drives.

To use this code, you'll need to add a reference.

Click Project -> References
Scroll to 'Microsoft Scripting Runtime'
Select it.

Code:
Option Explicit

Private Sub Form_Load()
    
    Dim FSO As Scripting.FileSystemObject
    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    MsgBox FSO.GetDrive("[!]C:\[/!]").SerialNumber
    Set FSO = Nothing
    
End Sub

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Hi gmmastros,

it works very good ...thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top