CMD

List Hard Drives using Command Prompt & PowerShell in Windows 10

List Hard Drives using Command Prompt & PowerShell in Windows 10

If you frequently work with the Command Prompt or PowerShell, you may need to copy files from or to an external drive, at such, and many other times, you may need to display the drives within the console window. In this post, we will show you how you can list drives using Command Prompt or PowerShell in Windows 10/8/7.

List Hard Drives using Command Prompt

If you need to simply list the drives, you may use WMIC.  Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems.

Open a command prompt, and type the following command:

wmic logicaldisk get name

Press Enter and you will see the list of Drives.

You can also use the following parameter:

wmic logicaldisk get caption

Using the following will display Device ID and volume name as well:

wmic logicaldisk get deviceid, volumename, description

Windows also includes an additional command-line tool for file, system and disk management, called Fsutil. This utility helps you list files, change the short name of a file, find files by SID's (Security Identifier) and perform other complex tasks.  You can also use fsutil to display drives. Use the following command:

fsutil fsinfo drives

It will show mapped drives too.

You can also use diskpart to get a list of drives along with some more details. The  Diskpart utility can do everything that the Disk Management console can do, and more! It's invaluable for scriptwriters or anyone who simply prefers working at a command prompt.

Open CMD and type diskpart. Next use the following command:

list volume

You will see that the console displays the Volume number and letter, label, formatting type, partition type, size, status, and other information.

List Hard Drives using PowerShell

To display drives using PowerShell, type powershell in the same CMD windows and hit Enter. This will open a PowerShell window.

Now use the following command:

get-psdrive -psprovider filesystem

Hope this helps.

Now see how you can get a list of all Device Drivers using Command Prompt.

Top 10 Games to Play on Ubuntu
Windows platform has been one of the dominating platforms for gaming because of the huge percentage of games that are developing today to natively sup...
5 найкращих аркадних ігор для Linux
В наш час комп’ютери - це серйозні машини, що використовуються для ігор. Якщо ви не можете отримати новий високий бал, ви зрозумієте, що я маю на уваз...
Битва за Веснот 1.13.6 Розробка випущена
Битва за Веснот 1.13.6, випущений минулого місяця, є шостим випуском розробки в 1.13.x, і це забезпечує низку вдосконалень, особливо до інтерфейсу кор...