List all Hard Drives in Command Prompt

List all Hard Drives in Command Prompt: When working in command prompt is always handy to know the drive letter of the hard drive your working on. The more hard drives you have in the computer, the more confusing it can be when using (cmd) command prompt. There is a simple command using wmic which will display all the hard drives on that machine and list all the drive letters. This is useful when copy files from one drive or partition to another or maybe you want to replace a corrupt file from a windows cd to a drive. Maybe you’re running a dual booted operating system and need to know exactly which drive you need to copy to. Its always nice to use this command no matter what the reason.

1. Open up a elevated command prompt.

  • Windows 7: Go Start button and type cmd in search box, now right click cmd

2015-07-06_13-10-53

  • Windows 8: Press the windows-8-logo +X  on the keyboard and click Command Prompt (Admin).
  • Now type the following command

wmic logicaldisk get deviceid, volumename, description wmic

wmic logicaldisk get deviceid, volumename, description

2. Filter drives by type

You can also show drives of a particular type using the wmic command.

  • Type the following command

wmic logicaldisk where drivetype=2 get deviceid, volumename, description

list-all-drives-in-cmd

I use the removable disk command drivetype=2  above, This will show all removable drives that are plugged into that computer. I have listed some other type of drives you can show below.

0 = Unknown
1 = No Root Directory
2 = Removable Disk
3 = Local Disk
4 = Network Drive
5 = Compact Disc
6 = RAM Disk

For more information on this topic click here

Leave a Reply