Windows – How to get hard drive serial number from command line?

From the Windows NT-based (Windows XP and 7 specifically) command prompt, how can I get the serial number of a hard drive as a variable? The one I’m looking at is the serial number of the physical hard disk drive

Solution:

Try this command

 

vol C:

this will get the volume serial number given to it by windows.

 

wmic diskdrive get serialnumber

this gets the manufacturers serial number of the hard drive.