Click to See Complete Forum and Search --> : serial number Not Volumn Serial Number
Phogang
September 6th, 2001, 09:02 AM
I need to know sourcecode about getting "serial number" of harddisk. Please help me.
note:
1. "serial number" NOT "Volumn Serial Number"
2. each harddisk has id called serial number
3. Volumn Serial Number is generated by "format" command
Iouri
September 6th, 2001, 09:07 AM
'ref to Microsoft Scripting Runtime
Sub ShowDriveInfo(drvpath)
Dim fs, d, s, t
set fs = CreateObject("Scripting.FileSystemObject")
set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
Select Case d.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
s = "Drive " & d.DriveLetter & ": - " & t
s = s & vbCrLf & "SN: " & d.SerialNumber
MsgBox s
End Sub
Iouri Boutchkine
iouri@hotsheet.com
Phogang
September 6th, 2001, 09:25 AM
Hello, Iouri.
The source code you have posted is "Volumn Serial Number" not "Serial Number" and i need " Harddisk Serial Number".
Thank You.
Phogang
September 6th, 2001, 10:34 AM
Who know? Please.
Iouri
September 6th, 2001, 02:20 PM
I used to write a prog that modifies hard drive or floppy Serial Number. The code that I gave you read this number correctly.
Iouri Boutchkine
iouri@hotsheet.com
John G Duffy
September 6th, 2001, 03:19 PM
I tried Iouris coed and it returned the drive serial number for me NOT its volume serial number.
Code output, in my case was
'
Drive C: - Fixed
SN: 982263575
'
'
My C: drives volume Serno is "Production"
John G
Iouri
September 6th, 2001, 03:28 PM
Thank you John. At least now I know that I am not going bananas.
Iouri Boutchkine
iouri@hotsheet.com
Phogang
September 6th, 2001, 09:02 PM
I tried Iouris coed and it returned the volume serial number.
Code output, in my case was
Drive C: - Fixed
SN: 220795131
Drive D: - Fixed
SN: 142088909
But my drive c and d are on the same harddisk (my harddisk has partioned to drive c and d)
the searial number i mean is unique Serial ID
Cimperiali
September 7th, 2001, 03:04 AM
'even this will bring up same result:
'you will get two different serail number for the two drives.
'It seems as if logical drives get their own serial number...
private Declare Function GetVolumeInformation Lib "Kernel32" Alias "GetVolumeInformationA" (byval lpRootPathName as string, byval lpVolumeNameBuffer as string, byval nVolumeNameSize as Long, lpVolumeSerialNumber as Long, lpMaximumComponentLength as Long, lpFileSystemFlags as Long, byval lpFileSystemNameBuffer as string, byval nFileSystemNameSize as Long) as Long
private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Serial as Long, VName as string, FSName as string
'Create buffers
VName = string$(255, Chr$(0))
FSName = string$(255, Chr$(0))
'get the volume information
GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
'Strip the extra chr$(0)'s
VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
MsgBox "The Volume name of C:\ is '" + VName + "', the File system name of C:\ is '" + FSName + "' and the serial number of C:\ is '" + Trim(Str$(Serial)) + "'", vbInformation + vbOKOnly, App.Title
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
nikidd
January 9th, 2003, 05:48 AM
:D There are thousands of questions and answers in the forum that looks to me the same:
"Get an unique PC number that doesn't change even if you reinstall Windows, format the drive or something like this."
And most of the answers aren't even close to this.
The Iouri's code returns Volume Serial Number that is generated when you format the volume. That means tha if you format your C: it will change his number!!!
I'm searching for a way (like Phogang does) to get the hardware's serial number. That mean the number that manufacturer of the HDD is give to it.
So, please stop posting messages with "GetVolumeInformation", "Scripting.FileSystemObject", etc.
That doesn't work the way we (me and probably Phogang) expect.
That mean Cimperiali too. Understand - this is not we looking for.
nikidd
January 10th, 2003, 05:50 AM
Hi to all,
yestarday i finally got something that is most like the HDD serial number (not the volume ser. num.)
Sorry but i have not enough time to check and test this but i hope it is what we looking for.
I found it on another vb source page, but i can't remember now (yestarday i browse more then 1000 pages :D ).
Ok. Bye.
mikesw
February 7th, 2009, 07:59 AM
Hi to all,
yestarday i finally got something that is most like the HDD serial number (not the volume ser. num.)
Sorry but i have not enough time to check and test this but i hope it is what we looking for.
I found it on another vb source page, but i can't remember now (yestarday i browse more then 1000 pages :D ).
Ok. Bye.
Can this program be updated to read Sata I and II drives along with any
USB type drives that are used on Sata, IDE/ATAPI adaptors and perhaps flash drives
to get the firmware version along with the serial number and drive model number?
Thanks.
dglienna
February 7th, 2009, 12:19 PM
This thread is too old. You've already posted a question. Don't double post.
mikesw
February 7th, 2009, 03:40 PM
well, I've looked at the source code for this program based on a referal to this thread.
The source code doesn't look for SATA I/II drives. The person who wrote the original
program before my post is NIKIDD. Thus, I thought he/she would see it and maybe
update their software they linked to along time ago. Particuliarily since in 2003
they didn't have SATA drives.
GremlinSA
February 8th, 2009, 06:36 AM
well, I've looked at the source code for this program based on a referal to this thread.
The source code doesn't look for SATA I/II drives. The person who wrote the original
program before my post is NIKIDD. Thus, I thought he/she would see it and maybe
update their software they linked to along time ago. Particuliarily since in 2003
they didn't have SATA drives.
Nikidd has not been online since March 31st, 2006 (according to his profile). And he did not write the source, he found it elsewhere... However it is a good start.. have you even tried to modify it to read USB and Sata drives...
Gremmy
mikesw
February 8th, 2009, 10:00 AM
No, since I'm not familiar with Visual Basic nor with whats needed to talk with
the hardware. Thus, I thought those who code in it, would be able to update
it lot quicker than for me to spend a few months trying to get it to work.
Also, I don't have the MSOFT visual Studio tools to even compile it.
dglienna
February 8th, 2009, 11:10 AM
Sure. Find me VB6 code that talks to a USB device that's attacthed to a SCSI port!
That's just about as likely.
Being a USB device, it can attach to ANYTHING. Checking for ANY device is beyond VB6.
Detecting a SCSI card (which can talk to 16 devices) is just as difficult.
This translates to not being done.
It might be doable in VS2008, if you write a custom driver, but it won't be on the web if someone does it
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.