[6 Ways] How To Fix ‘The Directory Name Is Invalid’ Error USB?

The directory name is invalid” error usually occurs while trying to access the files/folders stored in your USB drive, SD card, external or internal drive, CD/DVD drive etc. This error indicates that there is an issue with a directory path or name that you’re trying to access. It can arise due to various reasons, including incorrect file or directory names, permission issues, or corrupted system files. But fret not!

In this article, we’ll guide you through 6 effective methods to fix ‘the directory name is invalid USB’ error easily. So, without any further delay, let’s dive into it…….!

Rated Excellent on Trustpilot
Free USB Drive Data Recovery Tool.
Recover data from USB drives, Pen drives, SSDs, HDDs, and other devices on Windows. Try now!

The directory name is invalid error

How To Fix “The Directory Name Is Invalid” Error?

In this section, you’ll get the 6 workable methods to fix USB drive the directory name is invalid error.

So, if you are facing this error, just go through this straightforward way to address this issue successfully.

#1: Use Different USB Port

One of the most possible reasons behind “USB the directory name is invalid” error is the corrupted or damaged USB Port.

If your USB Port is corrupted due to any of the reasons like malware attack, moisture, dust, etc. then it’s likely to encounter errors like -“the directory name is invalid”, “USB device malfunction” etc.

To resolve this issue, try connecting your USB drive to different USB ports.

#2: Check The Path/File Or Folder Name

Sometimes entering the wrong/incorrect path, file, or folder name can cause “the directory name is invalid USB” error. Besides that, if you have used any special characters or long file paths, this might also result to this error.

So, you need to make sure that the file path you are using is correct and doesn’t contain any invalid characters or spaces.

#3: Run The CHKDSK Command

As we all know, CHKDSK is the Windows inbuilt utility that has enough capability to check for the integrity of the hard drives or file system errors and fix them effectively.

Hence, all you need to do is to connect your USB/SD card to a PC and run chkdsk on your Windows PC. Doing so will fix the drive corruption issue and will help you to access data stored within it.

Here are the easy steps to run chkdsk:

Step 1: First, press on the Win + R keys at the same time to open a Run window.

Step 2: In a search box, type the cmd >> press Enter.

cmd

Step 3: Then, copy & paste the command line- chkdsk e: /r /f. (Here, replace the ‘e’ with your drive letter)

chkdsk E: /f

Step 4: Next, press Enter key for initiating the process

Step 5: Now, the CHKDSK will thoroughly scan your hard disk for any corruption and fix it.

Step 6: After fixing the drive corruption, check if you are able to access the USB data without any error.

Also Read: Fix “USB Device Over Current Status Detected” Error

#4: Update The Disk Driver

Sometimes, the corrupted or outdated drivers can lead to the directory name is invalid or other hard drive-related issues. In such a case, updating outdated drivers or installing correct drivers can help you to troubleshoot this error as mentioned here.

Therefore, here also need to do the same thing by following the beneath steps:

  • On your desktop, you need to press a “Win + R” keys together.
  • After this, type the devmgmt.msc >> hit the “Enter” in order to launch a device manager.

diskmgmt.msc

  • Then, expand the “Disk Drives“.
  • Make a right-tap on a USB drive, SD card or external hard drive >> tap on “Update the Driver Software“.

Update Driver Software

After finishing these steps, now you can attempt to access the Disk again.

#5: Perform Clean Boot On Your PC

You may also perform a clean boot on your PC in order to find the problematic apps or programs that might be causing this error. After doing so, you may uninstall them by following the below-given steps:

  • Launch a RUN dialog box by pressing Win + R keys then type MSConfig in the search box.
  • After that, navigate to Services tab then tick the checkbox Hide all Microsoft Services & click on Disable All.

Hide all Microsoft Services

  • Now, go to the Startup tab then click on Open Task Manager.

Open Task Manager

  • Here, you need to choose the items that might causing this error & click on Disable.
  • That’s it, now you can exit the Task Manager then click the OK button on a Startup
  • Once done! Restart your system in a clean boot environment.
  • Follow the on-screen instructions and try to uninstall the problem causing apps or programs.

#6: Disable The DVD Drive

In few cases, you may receive “the directory name is invalid” error while try to play your DVD disc on PC. So here you can simply fix this issue by disabling the DVD drive.

  • Right-click on the Windows icon then choose Device Manager.
  • After that, expand the DVD/CD-ROM drives then right-click on your drive & select the option Disable Device.

Disable The DVD Drive

  • Now, you will be prompted to confirm your action, click Yes to disable your DVD drive.

Once done, find your drive and re-enable it again and you are done!

Watch this video guide to fix the “The directory name is invalid.” error in USB.

How To Recover Data From USB /SD Card/External Hard Drives?

After fixing the “USB drive the directory name is invalid” error, if you encounter a data loss situation then you can use the USB Drive Data Recovery Tool. It is a professionally recommended software that has help you recover all sorts of deleted data from your storage drive with ease.

This software not only recovers files from USB but from various external storage devices such as – SD/microSD cards, pen drives, hard drives, etc. without any backup.

The best thing about this utility is that- it supports both the OS: Windows as well as Mac systems. So, just download this program on your PC and run it.

emidTry Photo Recovery For Windows emidTry Photo Recovery For Mac
* Free version of the program only scans and previews recoverable items.

Here is the step-by-step guide that you need to follow to recover data from a USB drive.

Frequently Asked Questions:

How Do I Fix the Directory Name Is Invalid in Command Prompt?

In order to fix the directory name is invalid in Command Prompt, follow the below steps carefully:

  • Go to Start, then point to All Programs >> click on the Accessories.
  • After this, right-click on the Command Prompt or Notepad >> click Properties.
  • In a Start in the box, you have to change a value from the %HOMEDRIVE%%HOMEPATH% to the system-wide value like %WINDIR%.
  • Finally, click on OK option.

What Is a Directory on a USB?

The directory on a USB drive is a section that contains the backup images, feature keys, configuration files, certificates, & diagnostics information.

How Do I Change the Name of My USB Directory?

If you want to change the name of your USB directory, follow the below steps:

  • Connect your USB flash drive to PC.
  • Then, choose the drive which represents a USB drive & then right-click on it.
  • Here you will get the menu list, simply find & select Rename option. Now, you can provide a new USB directory name as per your choice.

Also Read: Fix Error Checking USB Drive Scanning and Repairing Stuck

Conclusion

Here, we have specified the major factors along with the corresponding approaches to fix “the directory name is invalid” USB error. Though, you can try the aforesaid solutions according to your situation and need.

However, in case of any data loss scenario, you can also try the recommended USB Drive Data Recovery Tool to get back your deleted USB data.

Last but not the least, if you liked this article then please share it with your family, friends, and relatives.

Reference – https://answers.microsoft.com/en-us/windows/forum/all/f-the-directory-name-is-invalid/61c2ab99-1afe-47c9-aa2f-d212ecb3eef4