---
title: "Get the USB Flash drive manufacturer using C#?"  
description: "Get the USB Flash drive manufacturer using C#?"  
author: "Anonymous User"  
published: 2013-10-16  
updated: 2013-10-16  
canonical: https://www.mindstick.com/forum/1693/get-the-usb-flash-drive-manufacturer-using-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 3 minutes  

---

# Get the USB Flash drive manufacturer using C#?

How can I get the manufacture of [USB](https://www.mindstick.com/articles/13074/what-makes-usb-c-cables-better-than-other-usb-cables) [Flash drive](https://answers.mindstick.com/qa/108555/what-to-do-if-your-computer-is-not-recognizing-usb-flash-drive) using C#?

## Replies

### Reply by Anonymous User

Below is example works for you. It uses WMI.

```
Console.WriteLine("Manufacturer: {0}", queryObj["Manufacturer"]);
Console.WriteLine("Name: {0}", c["Name"]); // here it will print drive letter
```

## The full code sample:

```
namespace WMISample
{
    using System;
    using System.Management;

    public class MyWMIQuery
    {
        public static void Main()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                    "SELECT * FROM Win32_DiskDrive");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    Console.WriteLine("DeviceID: {0}", queryObj["DeviceID"]);
                    Console.WriteLine("PNPDeviceID: {0}", queryObj["PNPDeviceID"]);
                    Console.WriteLine("Manufacturer: {0}", queryObj["Manufacturer"]);
                    Console.WriteLine("Model: {0}", queryObj["Model"]);
                    foreach (ManagementObject b in queryObj.GetRelated("Win32_DiskPartition"))
                    {
                        Console.WriteLine("  Name: {0}", b["Name"]);
                        foreach (ManagementBaseObject c in b.GetRelated("Win32_LogicalDisk"))
                        {
                            Console.WriteLine("    Name: {0}", c["Name"]); // here it will print drive letter
                        }
                    }
                    // ...
                    Console.WriteLine("--------------------------------------------");
                }
            }
            catch (ManagementException e)
            {
                Console.WriteLine(e.StackTrace);
            }

            Console.ReadLine();
        }
    }
}
```


---

Original Source: https://www.mindstick.com/forum/1693/get-the-usb-flash-drive-manufacturer-using-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
