---
title: "How to lookup Hard Drive model with C#?"  
description: "How to lookup Hard Drive model with C#?"  
author: "Takeshi Okada"  
published: 2013-10-16  
updated: 2013-10-16  
canonical: https://www.mindstick.com/forum/1698/how-to-lookup-hard-drive-model-with-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# How to lookup Hard Drive model with C#?

I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to get [device](https://www.mindstick.com/blog/149/retriving-network-device-information-in-c-sharp) information about particular [local](https://www.mindstick.com/forum/546/how-to-create-local-user-in-windows-8) hard drives. I've been able to create a few [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) [returning](https://www.mindstick.com/news/2477/returning-ceo-bob-iger-dismisses-the-disney-apple-sale-as-pure-speculation) [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best) using the [DriveInfo](https://www.mindstick.com/forum/161631/how-do-you-use-driveinfo-to-get-information-about-available-drives-and-their-free-space) [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) like this:

```
public string getDriveFormat(string driveName)
    {
        foreach (DriveInfo driveInfo in DriveInfo.GetDrives())
        {
            if (driveInfo.IsReady && driveInfo.Name == driveName)
            {
                return driveInfo.DriveFormat;
            }
        }
        return "";
    }
```

## Replies

### Reply by Samuel Fernandes

**Note: -** Add reference of System.management

\

```
WqlObjectQuery wqlObjectQuery = new WqlObjectQuery("SELECT * FROM Win32_DiskDrive");
ManagementObjectSearcher managementObjectSearcher = new ManagementObjectSearcher(wqlObjectQuery);
foreach (ManagementObject managementObject in managementObjectSearcher.Get()) {
Console.WriteLine("Hard Drive Caption = " + managementObject["Caption"]);
Console.WriteLine("Hard Drive DeviceID = " + managementObject["DeviceID"]);
Console.WriteLine("Hard Drive Decsription = " + managementObject["Description"]);
Console.WriteLine("Hard Drive Manufacturer = " + managementObject["Manufacturer"]);
Console.WriteLine("Hard Drive Media Type = " + managementObject["MediaType"]);
Console.WriteLine("Hard Drive Model = " + managementObject["Model"]);
Console.WriteLine("Hard Drive Name = " + managementObject["Name"]);
}
```

\

Not sure if you need to consider mounted drives as well:

```
foreach(ManagementObject managementObject in new ManagementObjectSearcher("Select * from Win32_Volume" ).Get())
{
  //Code Here
}
```


---

Original Source: https://www.mindstick.com/forum/1698/how-to-lookup-hard-drive-model-with-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
