How do I get a Flash Drive name from the command prompt?

  1.    #1

    How do I get a Flash Drive name from the command prompt?


    Hi, I would like to know if it is possible to get a flash drive name form the command line. With flash drive name I don't mean the volume name but how it is shown in taskbar in the remove usb part. I'm looking for something like:

    "Data Travelor 3.0"

    Does anybody know what command would show such information?

      My ComputerSystem Spec

  2. spapakons's Avatar
    Posts : 2,453
    Windows 10 Pro 64-bit 1803 (April 2018 build 17134.829)
       #2

    You could load the CMD (command prompt) and then issue the DIR command to see the folder's contents. If you are trying to see the root folder of a drive, at the beginning you see a description such as "This volume has no name" or "Volume DATA" or similar. To stop scrolling at one screen so you can read the description you need to use the pause attribute. So if your flash drive is F: you should issue the following commands (press ENTER at the end to execute) :

    Code:
    f:
    cd \
    dir /p
    The first command changes current Volume to F: (the flash drive). The second command makes sure we are into the root folder, not a subfolder. The last command displays the contents of the current folder but pauses at the end of the screen so you can read the description at the beginning. If you need to automate these commands, you hace to create a batch file (DOS script). This is simply a text file containing these commands. To create one open Notepad, copy-paste these commands and save with .bat extension (instead of .txt). If you replace F: with %1 (only in the batch file) you can then use the .bat file with parameter the drive letter of the Volume you want to see, such as:

    Code:
    example.bat F:
      My ComputerSystem Spec

  3.    #3

    Maybe one of of the WMIC command may be able to with refinement from the following ?

    wmic diskdrive get Model, InterfaceType
      My ComputerSystem Spec

  4. spapakons's Avatar
    Posts : 2,453
    Windows 10 Pro 64-bit 1803 (April 2018 build 17134.829)
       #4

    Not familiar with that command, sorry. I have not used command prompt since Windows 98 (all I remember is from MS-DOS era). Why do you need to do that in command prompt? If you are creating a program there should be some calls to do the same in GUI. Again not familiar with Visual programming, I have to program since late 90's at University.
      My ComputerSystem Spec

  5.    #5

    From PowerShell, run this command:

    Code:
    Get-Disk | Select Number, FriendlyName

    This will yield a list of disk numbers along with the Friendly Name for each disk. Example:

    Code:
    number friendlyname
    ------ ------------
         2 Crucial_CT500MX200SSD1
         0 SAMSUNG MZHPU512HCGL-00004
         1 ST4000DM000-1F2168
         3 ST8000DM004-2CX188
         5 SanDisk Cruzer
         4 SanDisk Extreme Pro
    Hope that helps!
      My ComputerSystem Spec

  6.    #6

    Let me just add one more piece of information. You can massage the output in countless ways. Looing at my example in my post above, assume you just wanted the friendly name for disk 4. You could do something like this:

    Code:
    get-disk -Number 4 | Select FriendlyName
    
    FriendlyName
    ------------
    SanDisk Extreme Pro
      My ComputerSystem Spec


  7.    #7

    @hsehestedt Thanks I'm writing that down on my useful tips section.
      My ComputerSystem Spec


 

Related Threads
Solved Command Prompt is missing from the drive. in Installation and Upgrade
Trying to get past the BitLocker on my Granddaughters Ideapad 100s 11IBY. Having tried several avenues to recover from the Locker, it was decided to start fresh with a re-install of Windows 10. As many of the functions were limited due to...
Unknowingly I fired the clean command in repair pc CMD while installing Windows 10. Please help to get all partitions? Problem: How to get back old partitions? Error Made: Unknowingly I fired the clean command in repair pc CMD, while installing...
I have read everything I can find on Error messages regarding looping of Preparing to Repair. I can not open my computer to Windows...it never loads. I started experiencing problems a while ago. Finally, I would be able to get on line, but only...
Does the HELP, /?, /help or ? work in the CMD Prompt of Drive X:\ (Windows Recovery Environment on Windows 10)? It doesn't on my computer, concerned it might be tampering if not simply a quirk of Windows RE.
The Update process for new Windows 10 builds has shown evolutionary changes over the past two years as part of the Insider Preview Programme. One noticeable change has been that the ability, by default, to observe behind the scenes events by...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 12:45.
Find Us