When formatting a drive or copying files from a drive to another drive, you may need to use the CMD or Windows PowerShell tool to list drives. However, many people don’t know how to list drives in Command Prompt or PowerShell, like a user from the superuser forum:
Is there a way to list the available drives from cmd.exe? (Other than manually typing c: d: …) and seeing which ones return errors.https://superuser.com/questions/139899/see-available-drives-from-windows-cli
How to List Drives in CMD
Command Prompt, also known as CMD, is the command-line interpreter in Windows operating system. You can input certain commands in the Command Prompt window to take corresponding actions. If you want to list drives of your systems, you can use the WMIC (Windows Management Instrumentation for Management) or Diskpart command.
List Drives CMD via WMIC:
Step 1. Press Win + R keys to open the Run dialog box, and then type cmd in it and press Ctrl + Shift + Enter keys together to open the elevated Command Prompt window.
Step 2. To let CMD list drives, type one of the following commands and hit Enter.
- wmic logicaldisk get name
- wmic logicaldisk get caption
Step 3. If you want to display the Device ID and volume name, type the following command and hit Enter. Also, you can run the fsutil fsinfo drives command to list drives on your computer
wmic logicaldisk get deviceid, volumename, description
List Drives CMD via Diskpart:
DiskPart is a disk partition management tool that uses command lines to perform operations. It can be used to list drives CMD as well. Here’s how to use it.
Step 1. Open the Command Prompt window again as we explained above.
Step 2. Type the following commands in order and hit Enter after each one. Then you will see a list of drives on the disk, including partition/volume number, label, letter, file system, size, and status.
- diskpart
- list disk
- select disk *
- list volume/list partition
How to List Drives in PowerShell
PowerShell is a command-line tool like CMD. Here you can let PowerShell list drives as well. To do so, follow the steps below:
Step 1. Open the Run dialog box, and then type powershell in it and hit Enter.
Step 2. In the Windows PowerShell window, type the following command and hit Enter.
get-psdrive -psprovider filesystem
How to let PowerShell/CMD list drive letters? Now, I believe that you already have known the answer.
Better Choice Than PowerShell/CMD List Drives
Although both of the two Windows tools can help you list drives, you may encounter some limitations to further managing drives/disks with them. For example, you can’t format a drive larger than 32GB to FAT32 using CMD. If you want to manage your hard disk or partitions more effectively, it’s highly recommended that you use a professional tool like MiniTool Partition Wizard.
MiniTool Partition Wizard DemoClick to Download100%Clean & Safe
It is a popular partition manager trusted by millions of users around the world. With this tool, you can not only obtain the drive information easily but do many other powerful tasks, including create/extend/move/format/wipe partition, convert NTFS to FAT32 without data loss, convert MBR to GPT, migrate OS, rebuild MBR, recover data, etc.