

You inserted your external disk to access some important files. However, in a flash, Windows gives out the message that “the directory name is invalid.” Only a few days back, this disk was going along very well. So, what has happened? But most importantly, can you ever open the files again, or are they gone completely?
You should not be worried, as in this guide, we’ll tell you what causes this malfunction and the process of rectifying it on Windows 10/11. Better still, we will also demonstrate how to restore your files safely, even if they’re inaccessible!
The “directory name is invalid” error in Windows 10/11 indicates that the system does not know where a particular path to a folder or a file is. Thus, you cannot access it. This error could manifest in the process of opening a program, attaching some external storage device, or even playing a DVD. The reasons why it materializes most often are as follows:
The file or folder path may be entered incorrectly or have been moved, renamed, or erased.
This error can be caused by problems with the file system (NTFS/FAT32) and by bad disk sectors.
Outdated or broken drivers can cause storage issues.
Malware can damage files or change folder names.
You might not have permission to access the folder or device.
Folder names with invalid characters or paths that are too long can trigger errors.
When you face an error like ‘the directory name is invalid’ on Windows 11/10 for a specific file and folder, you must first try to recover your data. This is because when you troubleshoot this malfunction, you might have to format the drive, which will result in data loss.
However, a malfunction like ‘the directory name is invalid’ on external hard drive or an internal one renders your files inaccessible. You can only retrieve them with a professional file recovery tool like 4DDiG Data Recovery that supports internal/external storage mediums. Here are this tool’s key features at a glance:
It can assist in restoring files that have been lost due to malware attacks, the crashing or the failure of booting the system, loss of partitions, etc.
It can extract files from over 2,000 storage devices.
This tool can restore 1000+ file formats like pictures, videos, and audio files, among others.
A free version is available for Windows users.
User-friendly interface and high success rate.
Follow the instructions beneath to reclaim data from a disk with the ‘the directory name is invalid’ error with this tool:
Step 1: Download and execute the tool on your computer. Then select the disk with the directory error.
Step 2: Choose the file types to scan. Click “Start.” You can pause or stop anytime.
Step 3: Preview the files and adjust filters and input keywords in the search bar to find the exact matches.
Step 4: Choose what you need. Hit “Recover” to save the reclaimed files to a safe location on your computer or cloud drive.
The following are 7 ways to troubleshoot an error, such as ‘the directory name is invalid’ on USB or any other external storage. Start with basic checks, then proceed with formatting the disk if the issue doesn’t resolve:
First, perform some basic inspections to rule out connection problems with the USB port, your computer, and physical damage to the external storage medium:
Disconnect and reconnect the external storage medium.
Try different USB ports. On desktops, use the back panel ports for better connection.
Look for damage on the connectors, cables, or devices.
Restart your computer after reconnecting.
Test the external storage device on another computer to check if the problem is with the disk itself.
Restarting your computer can also troubleshoot temporary glitches that might be causing an issue like ‘the directory name is invalid’ when opening file.
Sometimes, file system corruption, configuration, or settings issues can result in a malfunction like ‘the directory name is invalid’ on external hard drive. The Windows-embedded Troubleshooter can fix these issues that are causing this malfunction. Here’s how:
Step 1: Press Windows + R, write “msdt.exe -id DeviceDiagnostic,” and then click “OK.”
Step 2: Click on the “Next” button. This will execute the troubleshooter, which will scan for errors and repair them.
CHKDSK, another Windows-embedded tool, can help fix the external disk, like an SD card, ‘the directory name is invalid’ error. It can repair file system issues, correct errors in directory structures, and check metadata, leading to this issue. Here’s how:
Step 1: Connect the external disk with the error ‘the directory name is invalid’ on Windows 11/10 computer for access.
Step 2: Type “cmd” in the “Windows Search” field on the Desktop. Then, execute “Command Prompt.”
Step 3: Type the following command. Hit “Enter” afterward:
chkdsk [place the drive letter here]: /f /r
Step 4: Wait for CHKDSK to fix ‘the directory name is invalid’ on external hard drive.
Obsolete or corrupted disk drivers can also result in the external disk, like the SD card ‘the directory name is invalid’ error. So, to fix it, you can update the disk driver. If that doesn’t solve the problem, reinstall the driver. Here’s how to do that:
Step 1: Connect the ‘the directory name is invalid’ USB or another external drive to your computer for access. Right-click the “Start” button.
Step 2: Open “Device Manager.” Tap “Disk drives” to extend it. Then, right-click on the outdated disk driver. Select “Update driver.”
Step 3: Wait for Windows to automatically find and install the latest disk driver update.
Step 4: In case the update fails, follow “Step 1” and “Step 2.” But choose “Uninstall device” instead of “Update driver.”
Step 5: Reboot your computer. Windows will automatically reinstall a compatible disk driver.
Another disk’s driver letter might conflict with the external drive you’re trying to open the file on. This could lead to a malfunction like ‘the directory name is invalid’ when opening file. But you can fix it by giving a new drive letter to your external disk. To do so:
Step 1: Connect the ‘the directory name is invalid’ USB or another external drive to your computer. Right-click on the “Windows Start” button.
Step 2: Open “Disk Management.” Right-click the disk with the error. Then, choose “Change Drive Letter and Paths.” Next, click “Add.”
Step 3: Pick a letter for the disk from the drop-down menu. After this, tick mark the “Assign the following drive letter.” Hit “OK.”
Windows 10/11 also offers built-in SFC and DISM utilities that can troubleshoot a malfunction like ‘the directory name is invalid’ when opening file. The SFC tool can replace corrupted or missing system files, which might be leading to this issue. Whereas the DISM scan takes it up a notch and can repair the system image. Here’s how to execute both SFC and DISM:
Step 1: Connect an external disk, like SD card with ‘the directory name is invalid’ error to your computer for access.
Step 2: Input “cmd” in the “Windows search” field on the Desktop. Next, execute “Command Prompt.”
Step 2: Input the following DISM command. Hit “Enter” afterward:
DISM.exe /Online /Cleanup-image /Restorehealth
Step 3: Wait for DISM to finish scanning. Next, input the SFC command. Hit “Enter” afterward:
sfc /scannow
As a last approach, format the external drive if the earlier solutions can’t fix the error ‘the directory name is invalid’ on Windows 11/10. It will refresh the file system and remove the malfunction. Here’s what to do:
Step 1: Connect the external disk with the error to your computer for access. Right-click on the “Windows Start” button.
Step 2: Open “Disk Management.” Right-click the disk with the error. Then, choose “Format.”
Step 3: Pick NTFS as your file system. Adjust other configurations. Uncheck “Perform a quick format.” Next, hit “OK.”
The ‘the directory name is invalid’ error on Windows 10/11 may materialize because of many problems. This could be due to wrong file paths, broken file systems, faulty drivers, or storage mediums. Nevertheless, you can troubleshoot this malfunction by fixing the connection failure, executing CHKDSK, reinstalling/updating disk drivers, changing the drive letter, or reformatting the disk. But formatting can lead to the loss of data. So, you should save your files first using software as 4DDiG Data Recovery.