|
-
September 6th, 2001, 09:02 AM
#1
serial number Not Volumn Serial Number
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
-
September 6th, 2001, 09:07 AM
#2
Re: serial number Not Volumn Serial Number
'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
[email protected]
-
September 6th, 2001, 09:25 AM
#3
Re: serial number Not Volumn Serial Number
Hello, Iouri.
The source code you have posted is "Volumn Serial Number" not "Serial Number" and i need " Harddisk Serial Number".
Thank You.
-
September 6th, 2001, 10:34 AM
#4
Re: serial number Not Volumn Serial Number
-
September 6th, 2001, 02:20 PM
#5
Re: serial number Not Volumn Serial Number
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
[email protected]
-
September 6th, 2001, 03:19 PM
#6
Re: serial number Not Volumn Serial Number
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
-
September 6th, 2001, 03:28 PM
#7
Re: serial number Not Volumn Serial Number
Thank you John. At least now I know that I am not going bananas.
Iouri Boutchkine
[email protected]
-
September 6th, 2001, 09:02 PM
#8
Re: serial number Not Volumn Serial Number
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
-
September 7th, 2001, 03:04 AM
#9
Re: serial number Not Volumn Serial Number
'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: [email protected]
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
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
January 9th, 2003, 06:48 AM
#10
That's not correct
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.
.:: ::.
-
January 10th, 2003, 06:50 AM
#11
-
February 7th, 2009, 08:59 AM
#12
Re: Finally i have got something usefull
 Originally Posted by nikidd
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  ).
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.
-
February 7th, 2009, 01:19 PM
#13
Re: serial number Not Volumn Serial Number
This thread is too old. You've already posted a question. Don't double post.
-
February 7th, 2009, 04:40 PM
#14
Re: serial number Not Volumn Serial Number
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.
-
February 8th, 2009, 07:36 AM
#15
Re: serial number Not Volumn Serial Number
 Originally Posted by mikesw
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
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|