What Command Prompt Can Tell You About Your External Drive

Command Prompt is a text-based tool built into Windows that lets you see what files are on your external hard drive, check how much space is left, and run diagnostic tests without opening File Explorer. You type commands instead of clicking folders — it takes longer to learn but gives you access to information that the graphical interface hides.

The most useful commands for external drives are chkdsk (which scans for file system errors), dir (which lists files and folders), and diskpart (which shows drive capacity and partition details). Each one answers a different question: Is the drive corrupted? What's actually stored on it? How much space do I have left?

You do not need special software or administrator training to use these commands. You do need to know the drive's letter (usually D:, E:, or F: — not C:, which is your main Windows drive). If you are not sure which letter is yours, plugging in the drive and opening File Explorer will show it in the left sidebar.

Key Takeaways

  • Open Command Prompt by typing "cmd" into the Windows search box, then right-click and select "Run as administrator" to access all commands.
  • Use chkdsk D: /F (replacing D: with your drive letter) to scan for and repair file system errors, though the drive must not be in use when you run it.
  • Type dir D: to see a list of all files and folders on the drive, or dir D: /s to include files in subfolders.
  • Run diskpart and then list disk to see your drive's total capacity and whether it is recognized by Windows.
  • If a command fails or the drive does not appear, the drive may have a hardware problem or a file system that Windows does not recognize.

Opening Command Prompt With Administrator Access

Most useful drive commands require administrator privileges, which means Windows needs permission to let the command run. Without it, you will see an error message saying "Access Denied" even if the command is typed correctly.

To open Command Prompt as administrator: click the Windows search box (bottom left of your screen), type cmd, and wait for "Command Prompt" to appear in the results. Right-click on it and select "Run as administrator." A window will ask "Do you want to allow this app to make changes to your device?" — click "Yes." The Command Prompt window will open with a black background and white text.

You will know you have administrator access when the title bar says "Administrator: Command Prompt" at the top. If it just says "Command Prompt" without the word "Administrator," you did not run it as administrator and some commands will fail.

Finding Your External Drive's Letter and Basic Information

Before you run any command on your external drive, you need to know which letter Windows assigned to it. Plug in the drive, wait a few seconds for Windows to recognize it, then open File Explorer (the folder icon on your taskbar). Look at the left sidebar under "This PC" — your external drive will be listed with a letter next to it, like "External Drive (D:)" or "My Backup (E:)."

Once you know the letter, you can check whether the drive is visible to Command Prompt. In the Command Prompt window, type diskpart and press Enter. Then type list disk and press Enter. You will see a list of all drives connected to your computer, numbered as Disk 0, Disk 1, and so on. Each line shows the disk number, status, total size, and free space. Find the one that matches your external drive's size — if it shows "Online," Windows recognizes it. If it shows "Offline," the drive may have a hardware problem.

Type exit to leave diskpart and return to the regular Command Prompt prompt.

Checking Drive Space and File Count With dir

The dir command shows you what is stored on your drive and how much space is used. In Command Prompt, type dir D: (replacing D: with your drive's letter) and press Enter. You will see a list of all files and folders in the root of the drive — the top level, not inside any subfolder.

Each line shows the date the file was created or modified, the time, whether it is a folder (marked with <DIR>), the file size in bytes, and the file name. At the bottom, Command Prompt shows the total number of files, total number of directories, and how many bytes are free on the drive.

If you want to see files inside subfolders too, type dir D: /s instead. This will take longer if the drive has many files, but it shows you everything. To save the list to a text file so you can read it later, type dir D: /s > drivelist.txt and press Enter. The file "drivelist.txt" will be saved in your Documents folder.

Scanning for File System Errors With chkdsk

chkdsk is the command that checks your drive for corruption — missing files, broken links between files, and other problems that can make the drive slow or unreliable. It is the most powerful diagnostic tool Command Prompt offers, but it also requires the most setup.

To run chkdsk, type chkdsk D: /F (replacing D: with your drive's letter) and press Enter. The /F flag tells chkdsk to fix errors it finds. If the drive is currently in use — meaning Windows is reading from it or you have files open on it — Command Prompt will ask "Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts?" Type Y and press Enter. The drive will be checked the next time you restart your computer, before Windows fully loads.

If the drive is not in use, chkdsk will run when ready. It will show a progress bar and report how many errors it found and fixed. This can take anywhere from a few minutes to an hour, depending on the drive's size and how many errors exist.

If chkdsk fails with an error message like "The type of the file system is NTFS" or "The volume is not NTFS," your drive may be formatted in a file system that Windows does not recognize — possibly exFAT, FAT32, or a Mac format. In that case, chkdsk cannot repair it, but the drive itself may still be fine.

Understanding Common Error Messages

If a command does not work, Command Prompt will show an error message. The most common ones are "The system cannot find the path specified" (the drive letter is wrong or the drive is not plugged in), "Access Denied" (you did not run Command Prompt as administrator), and "The volume is write-protected" (the drive has a physical lock switch, usually on the side, that prevents writing).

If you see "The type of the file system is NTFS" or similar, your drive is formatted in a file system that Windows recognizes but chkdsk cannot repair on an external drive. This is not a failure — it means the drive is fine, but you will need different tools to fix corruption if it occurs.

If a command hangs (stops responding and does not show a new prompt), press Ctrl+C to stop it. If the drive does not appear in diskpart's list at all, try unplugging it, waiting 10 seconds, and plugging it back in. If it still does not appear, the drive may have a hardware failure.

When to Use Command Prompt vs. Other Tools

Command Prompt is useful when you need to see detailed information quickly or when the graphical interface is not working — for example, if File Explorer crashes when you open the drive. It is also the fastest way to check free space and scan for errors without installing extra software.

However, if you are not comfortable typing commands, File Explorer's Properties window (right-click the drive and select "Properties") shows free space and total capacity in a simpler format. For more detailed diagnostics — like checking the drive's temperature, reading count, or power-on hours — you may need third-party software designed for that purpose, which is beyond what Command Prompt can do.

If chkdsk reports errors that it cannot fix, or if the drive does not appear in Command Prompt at all, the drive may have a hardware problem that requires professional data recovery. Command Prompt can diagnose the problem but cannot solve hardware failures.

Frequently Asked Questions

Do I have to run chkdsk, or will it damage my files?

chkdsk will not damage your files. It scans the file system — the structure that tells Windows where files are stored — and fixes broken links. If it finds a file that is corrupted beyond repair, it may move it to a folder called "Found.000" so you can decide what to do with it, but it does not delete anything without asking first.

What does "The volume is in use" mean, and how do I fix it?

It means Windows is currently reading from or writing to the drive, so chkdsk cannot safely scan it. Close any files you have open on the drive, make sure no programs are using it, and try again. If it still says the volume is in use, restart your computer and let chkdsk run at startup.

Can I use these commands on a drive formatted for Mac?

No. If your drive is formatted in HFS+ or APFS (Mac formats), Windows will not recognize it at all, and the drive will not appear in File Explorer or diskpart. You will need to reformat it to NTFS or exFAT on a Mac first, or use third-party software on Windows that can read Mac formats.

How long does chkdsk usually take?

It depends on the drive's size and how many files are on it. A 1 TB drive with no errors might take 10 to 20 minutes. A drive with many errors or a very large capacity can take an hour or more. You can leave it running in the background — you do not have to watch the window.

What if Command Prompt shows the drive has no free space left?

If dir shows 0 bytes free, the drive is full. You will need to delete files to make room. However, if you cannot see files in File Explorer that match the used space, hidden system files or corrupted data may be taking up room. Run chkdsk to check for corruption, or use a third-party tool that can show hidden files.