Last updated on April 22, 2024
Want to learn how to list drives in Command Prompt (CMD) and PowerShell? This guide from /Tools will show you two methods: using the built-in command-line tool CMD and PowerShell.
Command Prompt and PowerShell are powerful interfaces in Windows. While Command Prompt has long been used for running commands, PowerShell offers advanced features. Both tools allow users to interact with the system through text-based commands, making tasks more efficient.
There are two primary methods to list drives in the Command Prompt (CMD): Diskpart and WMIC. Let's learn how to list drives via CMD.
Diskpart is a powerful command-line tool specifically designed for managing disk drives and partitions. Here's how you'd use it to list your drives in American English: 1. Press the Windows key + X on your keyboard. 2. Click on "Command Prompt (Admin)" or "Windows PowerShell (Admin)" to open an elevated command prompt. 3. Type "diskpart" and press Enter. This will launch the Diskpart utility. 4. Inside Diskpart, type "list disk" and press Enter. This will display a list of all the disks connected to your system. That's it! You'll see the disks numbered along with some basic information like size and status.
Step 1: Open the Command Prompt. Type CMD in the Windows search bar and then hit Enter to open it.
Step 2: At the command prompt, enter each of the following commands one by one, and press "Enter" after each command:
diskpart
list disk
select disk X (replace "X" with the disk number)
list volume OR list partition
Here, you can see the list of drives on the disk, including Partition/Volume number, Label, Drive letter, File system, Size, and Status. After listing the drives with Diskpart, you can perform more operations using this utility:
Please provide the English content you'd like translated, I'll do my best to translate it into Chinese for you.
WMIC (Windows Management Instrumentation Command-line) is a versatile tool that allows you to query various system components, including hard drives. Here's how to use WMIC to list your drives:
Step 1: Open the Command Prompt and type one of the following commands, then press Enter.
Query logical disk names using WMIC
Query logical disk labels using WMIC
Step 2: To view the device ID and volume name, type the following command and press "Enter." Alternatively, you can use the fsutil fsinfo drives command to list the drives on your computer.
Use the wmic command to query the device ID, volume name, and description of logical disks
Let's switch gears and see how another powerful command-line tool, PowerShell, can list drives. PowerShell provides a more modern, object-oriented approach to system administration than CMD. Here's how you can list drives with PowerShell:
Step 1: Search for “PowerShell” in the Windows search bar, then click on it to open.
Step 2: Type the following command, and then press Enter.
Get-PSDrive -PSProvider FileSystem
Was the information in this article helpful to you? Feel free to share it with others.
If you're looking for a simpler alternative to the command line complexity of Command Prompt and PowerShell, consider using a tool like Partition Master Professional for smooth disk management. Its user-friendly interface makes it easy to manage your drives.
Here are some of its virtues:
So why bother with complicated command line interfaces when you can manage your disks with ease using tools like Partition Master? Download this powerful tool now and experience its convenience and efficiency for yourself.
This guide explores two methods of listing drives in Windows: the tried-and-true Command Prompt (CMD) with its diskpart and WMIC utilities, as well as the more modern PowerShell. While both offer powerful tools, the arcane commands they employ might be an obstacle for some users to understand and use.
"Partition Master streamlines disk management with a clean graphical interface, sparing you the need to decipher complex syntax! The software not only lets you view your drives but also perform various tasks such as formatting, extending partitions, migrating operating systems, and even securely wiping disks."
Don't forget to share your knowledge with others!
Need help listing drives in Command Prompt or PowerShell? Follow this FAQ.
How do I get a list of all drives in CMD?
There are two primary ways to list all drives in CMD, and both methods assume that you're running the Command Prompt as an administrator:
wmic logicaldisk get name
or wmic logicaldisk get caption
will display a list of drive letters associated with your partitions.2. How do I get disk information from CMD?
You can use diskpart via CMD to obtain disk information:
3. Is PowerShell the same as CMD?
No, CMD is the classic text-based command prompt, while PowerShell is a newer, more object-oriented system administration tool.