Fix USB The Directory Name is Invalid Error and Recover Data Now
This guide explains how to fix the USB directory name is invalid error. If your pen drive is showing a directory name is invalid, we provide step-by-step solutions from basic CHKDSK repairs to advanced data recovery techniques to save your files.
USB Says Directory Name is Invalid
'The directory name is invalid' when plugging in a USB stick.
When I plug in my USB stick, Windows says 'The directory name is invalid'. When I click on the drive, it says 'please insert a disk into the USB drive(E:)'. No space/capacity is displayed in drive properties, the Error Checking under the Tools tab shows an error 'the disk check could not be performed because Windows can't access the disk'. Windows isn't able to format it either. What I think went wrong is that I formatted the USB in Ubuntu, and Ubuntu is crazy.
How do I save my USB? (It's my favorite USB with a flipped credit card design and Van Gogh portrait printed on it; also, this model is discontinued.)
- Question from reddit.com
You’re in a hurry, you plug in your trusty flash drive, and instead of seeing your files, Windows hits you with a cryptic and frustrating message: The directory name is invalid. These files on the USB drive are seemingly gone, but still take up space. The "invalid" part of the message points directly to a corrupted file system, meaning the map your computer uses to find files on the drive has been damaged.
Don't worry, this guide will not only demystify why this happens but also provide a clear, step-by-step path to recover your files and restore your drive to working order.
Why Pen Drive Showing "Directory Name is Invalid"?
Generally speaking, your USB drive has a built-in table of contents called a file system (like NTFS or FAT32). When you plug it in, Windows asks for this table to display your files.
However, if you have a corrupted file system, your USB shows “The directory name is invalid”, which means it’s a communication breakdown. So, Windows can't read the names of the main folders, let alone what's inside them. The directory, or folder structure, has become unreadable.
There are multiple culprits for the corrupted file system:
✔️ Power surges or a dying USB port can have the same disastrous effect.
✔️ Malicious software has a nasty habit of tampering with system files and storage devices. A virus might intentionally corrupt the file system to hide itself or simply damage it as a side effect of its activities.
✔️ Outdated disk drivers might cause this problem.
Now that we know what we're up against, let's run through the quick and easy fixes you should always try first.
How to Fix "The Directory Name is Invalid" on Flash Drive?
How to fix "The Directory Name is Invalid" error in Windows 11, 10 computer easily? Try the following proven solutions now.
Way 1. Safely Eject and Reconnect the USB Drive
Please start with the digital equivalent of turning it off and on again.
1. First, if you can, use the "Safely Remove Hardware" icon in your system tray to eject the drive properly.
2. If the error prevents that, simply shut down your computer completely. Once it's off, unplug the flash drive.
3. Wait a moment, then power your PC back up.
4. Once you're at the desktop, plug the drive back in. This simple reset can clear temporary driver conflicts and re-establish a clean connection.
Way 2. Run the CHKDSK Utility in Windows
If a simple reconnect doesn't work, it's time for CHKDSK (Check Disk). This is a built-in Windows tool that scours the drive for file system errors and attempts to fix them on the spot. To run it, you'll need to use the Command Prompt.
1. Type "cmd" into your Windows search bar, right-click on Command Prompt, and select "Run as administrator".
2. In the black window, type chkdsk X: /f /r (replace "X" with your USB drive's actual letter) and hit Enter.
The /f parameter tells it to fix any errors it finds. The /r parameter checks file system errors and locates bad sectors, then attempts to recover readable information from them.
It’s a powerful first-aid tool for a corrupted drive.
Way 3. Check the Drive on Another Computer
This is a brilliant and simple diagnostic step. If your flash drive directory name is invalid on your main PC, try plugging it into another laptop or desktop.
If it works perfectly on the second machine, the problem is almost certainly with your original computer's USB drivers or ports.
If it fails on both, you've confirmed the issue is with the drive itself, and you can focus your efforts there.
Way 4. Update Disk Drivers
Sometimes, outdated disk drivers cause the “The directory name is invalid" on flash drive error. So, you can update the disk drivers to fix it now. To do so:
1. Press Windows + R, type devmgmt.msc, and hit Enter to launch Device Manager.
2. Expand the Disk Drives section.
3. Right-click your USB flash drive and select Update Driver.
4. If a properties window appears, navigate to the Driver tab and click Update Driver there, then click OK.
Fast Recover Files from USB Drive If Required
This is the most critical part for most users: get your files back. When you have a pen drive showing "The directory name is invalid", the data is usually still physically on the device, but the road map to it is destroyed. This is where data recovery software shines, as it can scan the raw storage sectors, bypassing the corrupted file system to find your files.
Fortunately, MyRecover is the exclusive Windows data recovery software, which ignores the corrupted file system and performs a deep, sector-by-sector scan of the flash drive, looking for the signatures of known file types (like JPEGs, DOCX files, etc.). This allows them to find and rebuild your files even when Windows thinks the drive is a lost cause.
Enjoy the benefits with MyRecover:
- Easy Recovery. With a 99% recovery rate, you can use it to easily find the missing files, then recover them all at once.
- Preview Before Recovery. It’s very helpful to recover needed files from a flash drive, even when it shows “The Directory name is invalid”.
- Recover unlimited files. If you have lost a large number of files, it helps you out of this trouble.
- Intuitive Interface. You can recover files easily with a few clicks because it provides a user-friendly interface.
Here is how to recover files from the USB flash drive that has an invalid directory name with MyRecover:
1. Connect the USB flash drive to your Windows 11/10 computer, and ensure it can be detected even if it shows the error message.
2. Download and install MyRecover, then launch it. Tap USB/SD Card Recovery, choose the problematic USB drive, and hit Scan.
3. Press OK when it’s finished.
4. Preview these files to ensure they are intact, and choose them, then hit Recover.
5. Select a safe location and hit Select Folder to save these recovered files.
- ★Tips:
- It not only provides a quick scan but also a deep scan, which allows you to find every possible file to recover.
- Once the scan is complete, you can browse through the recoverable files. They are often organized by file type, date, and the original folder structure (if it can be determined). You can also search to find them quickly.
- If you are trying to recover files from unlimited computers, MyRecover Technician is your best shot.
Once the process is complete, your precious files are safe, and you can then proceed to repair or format the USB drive itself.

- Recover Deleted Files Easily with Simple Clicks
- 1000+ File Formats Supported
- Support HDD, SSD, External Hard Drive, USB Drive, SD Card, etc.
- Quickly Find Files Using File Types, Name, Size, etc.
- Preview Files Before Recovering
- Recover Unlimited Data
FAQs about Flash Drive Directory Name is Invalid
Q: What does "USB Directory Name is Invalid" actually mean?
A: It means the drive's file index is corrupted. Your data is likely still there, but the computer can't find it, like having a library full of books with no catalog system.
Q: Can I fix this error without losing all my data?
A: Yes. First, recover files using a tool like MyRecover. Then, use CHKDSK or format the drive to repair it. Always recover data before attempting repairs.
Q: Is the CHKDSK command safe to run on my USB drive?
A: Generally, yes, but it can alter data during repair. For the best chance of recovery, use data recovery software before running CHKDSK.
Q: Why does my pen drive keep showing the directory name is invalid on different computers?
A: This confirms the drive itself is faulty. The file system is permanently corrupted, or the physical memory chips are failing, especially in older or heavily used drives.
Q: Will formatting the drive fix the error for good?
A: Usually, but it erases all data. Recover files first. If the drive is physically damaged, formatting may only provide a temporary fix before the error returns.
The End
After reading here, your USB flash drive should have been fixed, and no longer error message "The directory name is invalid". Besides, it’s very important to back up important files in case of data loss. If your files get lost, MyRecover can do you a big favor. You can use it to recover files from a formatted SSD, recover files from an unformatted partition, recover files from a damaged partition, etc.