title: Get HDD (and NOT Volume) Serial Number on Vista Ultimate 64 bit
body: <p>I was once looking for getting the HDD serial number without using WMI, and I found it. <a href="https://stackoverflow.com/questions/278062/converting-hdd-serial-vb6-code-into-vb-net-code">The code I found and posted on StackOverFlow.com</a> works very well on 32 bit Windows, both XP and Vista. The trouble only begins when I try to get the serial number on 64 bit OSs (Vista Ultimate 64, specifically). The code returns String.Empty, or a Space all the time.</p>
  
  <p>Anyone got an idea how to fix this?</p>
  
  <p>EDIT:</p>
  
  <p>I used the tools Dave Cluderay suggested, with interesting results:</p>
  
  <p>Here is the output from DiskId32, on Windows XP SP2 32-bit:</p>
  
  <pre><code>To get all details use "diskid32 /d"
  Trying to read the drive IDs using physical access with admin rights
  Drive 0 - Primary Controller -  - Master drive
  Drive Model Number________________: [MAXTOR STM3160215AS]
  Drive Serial Number_______________: [            6RA26XK3]
  Drive Controller Revision Number__: [3.AAD]
  Controller Buffer Size on Drive___: 2097152 bytes
  Drive Type________________________: Fixed
  Drive Size________________________: 160041885696 bytes
  
  Trying to read the drive IDs using the SCSI back door
  
  Drive 4 - Tertiary Controller -  - Master drive
  Drive Model Number________________: [MAXTOR STM3160215AS]
  Drive Serial Number_______________: [            6RA26XK3]
  Drive Controller Revision Number__: [3.AAD]
  Controller Buffer Size on Drive___: 2097152 bytes
  Drive Type________________________: Fixed
  Drive Size________________________: 160041885696 bytes
  
  Trying to read the drive IDs using physical access with zero rights
  
  **** STORAGE_DEVICE_DESCRIPTOR for drive 0 ****
  Vendor Id = []
  Product Id = [MAXTOR STM3160215AS]
  Product Revision = [3.AAD]
  Serial Number = []
  
  **** DISK_GEOMETRY_EX for drive 0 ****
  Disk is fixed
  DiskSize = 160041885696
  
  Trying to read the drive IDs using Smart
  
  Drive 0 - Primary Controller -  - Master drive
  
  Drive Model Number________________: [MAXTOR STM3160215AS]
  Drive Serial Number_______________: [            6RA26XK3]
  Drive Controller Revision Number__: [3.AAD]
  Controller Buffer Size on Drive___: 2097152 bytes
  Drive Type________________________: Fixed
  Drive Size________________________: 160041885696 bytes
  
  Hard Drive Serial Number__________:             6RA26XK3
  
  Hard Drive Model Number___________: MAXTOR STM3160215AS
  </code></pre>
  
  <p>And DiskId32 run on Windows Vista Ultimate 64-bit:</p>
  
  <pre><code>To get all details use "diskid32 /d"
  
  Trying to read the drive IDs using physical access with admin rights
  
  Trying to read the drive IDs using the SCSI back door
  
  Trying to read the drive IDs using physical access with zero rights
  
  **** STORAGE_DEVICE_DESCRIPTOR for drive 0 ****
  Vendor Id = [MAXTOR S]
  Product Id = [TM3160215AS]
  Product Revision = [3.AA]
  Serial Number = []
  
  **** DISK_GEOMETRY_EX for drive 0 ****
  Disk is fixed
  DiskSize = 160041885696
  
  Trying to read the drive IDs using Smart
  
  Hard Drive Serial Number__________:
  
  Hard Drive Model Number___________:
  </code></pre>
  
  <p>Notice how much lesser the information is on Vista, and how the Serial Number is not returned. Also the other tool, EnumDisk, refers to my hard disks on Vista as "SCSI" as opposed to "ATA" on Windows XP. </p>
  
  <p>Any ideas?</p>
  
  <p>EDIT 2:</p>
  
  <p>I'm posting the results from EnumDisks:</p>
  
  <p>On Windows XP SP2 32-bit:</p>
  
  <pre><code>Properties for Device 1
  
  Device ID: IDE\DiskMAXTOR_STM3160215AS_____________________3.AAD___
  
  Adapter Properties
  ------------------
  Bus Type       : ATA
  Max. Tr. Length: 0x20000
  Max. Phy. Pages: 0xffffffff
  Alignment Mask : 0x1
  
  Device Properties
  -----------------
  Device Type     : Direct Access Device (0x0)
  Removable Media : No
  Product ID      : MAXTOR STM3160215AS
  Product Revision: 3.AAD
  
  Inquiry Data from Pass Through
  ------------------------------
  Device Type: Direct Access Device (0x0)
  Vendor ID  : MAXTOR S
  Product ID : TM3160215AS
  Product Rev: 3.AA
  Vendor Str :
  
  
  
  ***  End of Device List  ***
  </code></pre>
  
  <p>And on Vista 64 Ultimate:</p>
  
  <pre><code>Properties for Device 1
  
  Device ID: SCSI\DiskMAXTOR_STM3160215AS_____3.AA
  
  Adapter Properties
  ------------------
  Bus Type       : FIBRE
  Max. Tr. Length: 0x20000
  Max. Phy. Pages: 0x11
  Alignment Mask : 0x0
  
  Device Properties
  -----------------
  Device Type     : Direct Access Device (0x0)
  Removable Media : No
  Vendor ID       : MAXTOR S
  Product ID      : TM3160215AS
  Product Revision: 3.AA
  
  Inquiry Data from Pass Through
  ------------------------------
  Device Type: Direct Access Device (0x0)
  Vendor ID  : MAXTOR S
  Product ID : TM3160215AS
  Product Rev: 3.AA
  Vendor Str :
  
  
  
  ***  End of Device List  ***
  </code></pre>