hi all!!
how can i check the serial number of my HDD through VB??
thnx
Printable View
hi all!!
how can i check the serial number of my HDD through VB??
thnx
This is out of the code MartinLiss has in the codebank for a program registration scheme.
VB Code:
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 Public Function GetSerialNumber() As Long Dim strVolumeBuffer As String Dim strSysName As String Dim lngSerialNumber As Long Dim lngSysFlags As Long Dim lngComponentLen As Long Dim lngResult As Long strVolumeBuffer$ = String$(256, 0) strSysName$ = String$(256, 0) lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _ lngComponentLen, lngSysFlags, strSysName$, 255) GetSerialNumber = lngSerialNumber End Function
thnx.............but it gives the HDD volume number.............i want to see the HDD serial number!!!
worry not...............i read the other similar post n got it!! thnx DG
abt Volume number, if someone can tell me how can i check it in Windows??
I thought that's what you wanted.
Quote:
but it gives the HDD volume number...
isn't serial number n volume number 2 different things??? if yes how can i check the volume number thru windows??Quote:
Originally Posted by dglienna
actually, i thought these 2 are different things from the other similar post where u posted ur reply!!! i have absolutely no idea abt them.......these 2 numbers!!
plz if u can explain!!!
There is the Hardware Serial Number, which is different for each hard disk, and cannot be changed. The Volume Serial Number is created each time the disk is formatted. Volume Serial Numbers conform to a standard, so they can be used in calculations.
thnx.......u helped me in checking it thru vb.......how can i check it thru windows???
Didnt you get this answered already? But anyways here is the link.
http://vbnet.mvps.org/code/disk/smartide.htm
I don't think that you can, unless it's stored in the registry somewhere.
oh thnx Rob............i saw that link already!!!!Quote:
Originally Posted by RobDog888
You would have to check it in the BIOS before boot up manually. There are some HD manufacturers that provide a utility for reading the serial number but theyare probably written in C++
Did it not work for you then?
It didnt work for me as I am running two sets of RAID Mirrors so all four of my hard drives dont show any results.
i know that serial number is stored in BIOS.......i was asking abt how to check the volume number thru windows!!Quote:
Originally Posted by RobDog888
Manually through windows or programatically? You have seen that link but havent stated if its working for you.
Here is a screenie of my Intel RAID management utility. I had a drive die recently and havent replaced it yet or it would show both drives serial numbers. These are the serial numbers that are on the physical drive itself.