Get USB Flash Drive Serial Number with PowerShell or Command Line
Easily get the hard coded serial number of a USB flash drive with either the Command prompt in Windows or Powershell. Of the two, Powershell is easier. Below are the instructions. After the instructions there is a bit more information about the different types of serial numbers which can be found associated with a Mass Storage Device (USB flash drive) so be sure to read that part as well, so you get what you want!
In the Windows Search bar, type “powershell” and click Enter
The Powershell utility will run and simply copy and past the following:
Get-WmiObject Win32_DiskDrive | select Model, Name, InterfaceType, SerialNumber
The screen shot below shows the hard drive of the system and a USB flash drive. The command doesn’t clearly label each, so be a little aware of the devices connected compared to what is listed. It is suggested to have only one USB device connected while running Powershell so it is easy to identify the device.
For the Command prompt, go to the USB flash drive itself. In the navigation field at the top (where you can type things) type in cmd. This will open the Command prompt for the USB flash drive itself. From here, copy and paste the following:
wmic path Win32_USBControllerDevice get Dependent | find “USBSTOR”
The screen shot below shows the same result as the Powershell command, BUT the string does have an extra &0 which is not part of the USB flash drive device. So a bit of parsing is required when looking at the number, or parsing of code if you plan to use the Command prompt to find the device serial number programmatically.
From the two above the Powershell solution is a bit more elegant.
However; may we suggest a third option? If you find yourself on this page, there is a high probability there are other features you can benefit from, like making an Image file of your USB stick, or speed benchmarking the performance of your flash drive.
If that is the case, then we recommend our free program, no installation required, standalone exe file that will fetch the serial number of a device as well as provide a tool to create image files or speed test your USB flash drive.
You may download the free program here. Again, no installation required, this is a standalone exe file that can run from your flash drive or hard drive:
FREE DOWNLOAD: Nexcopy USBScrub