Solved: The Directory Name is Invalid in Windows 10

Summary: This blog explains the causes of the ‘The Directory Name is Invalid’ error in Windows 10 and methods to fix it. In case you lose data due to this error, you can recover data from Windows PCs and external storage devices using data recovery software.

?The Directory Name is Invalid? error message (See Image 1) may occur at any moment. Whether you are trying to open a program after installing Windows 10, connect any external storage devices, or play a DVD drive on your system. It may occur due to multiple reasons such as corrupt system files, faulty applications/software, and corrupt devices like USB, HDD, SD, or DVD, etc. This error prevents you from accessing your data stored on the system or drives. However, you may get back access to the data with the help of a data recovery tool. Though in order to fix this error, you may try the following methods.

Image 1: The directory name is not valid error

How to fix ?The Directory Name is Invalid? error?

This error may occur in different situations with different devices.

F:\ The directory name is invalid on Windows 10

You can try to fix this error with the help of the following methods:

Method 1: Check Disk Error

Sometimes, system hard disk may be the actual cause of this error. Hence, to check if it the main cause and fixing it, you may use Disk check, a Windows utility to scan internal as well as external drives for fixing them.

a. Press Windows + E to open File Explorer and go to This PC. (See Image 2)

Image 2: Open File Explorer and go to This PC

b. Go to Local Disk, right-click on it and select Properties (See Image 3)

Image 3: Right-click on Local Disk and select Properties

c. Now, go to the Tools tab and click Check. (See Image 4)

Image 4: Go to Tools and click Check

d. Click Scan Drive (See Image 5).

Image 5: Select Scan drive

e. Once done, restart your system and check if this method helped you to fix this issue.

Method 2: Run CHKDSK Command

You can also run the CHKDSK command to find any corruption with any of your device and fix them to get rid of the ?The Directory Name is Invalid? in Windows 10. To do so, follow this:

a. Press Windows + X, locate and open Command Prompt (Admin). (See Image 6)

Image 6: Open Command Prompt (Admin)

b. In the open window, type chkdsk /f /r d: and hit Enter. (See Image 7)

Image 7: Run CHKDSK Command

If there is any corruption or other errors with the device, this command may fix them and you may get rid of this error. However, there is one thing you need to keep in mind that this utility finds and marks Bad Sectors on the device and helps Windows understand not to read or store any data on those sectors.

However, this error may lead to loss of all your important data stored in those sectors of the device. To deal with such situation, you may recover data even after running the CHKDSK command on your device with the help of a data recovery tool, such as Stellar Data Recovery. This DIY software can recover lost data from Windows PCs and all storage devices.

Method 3: Perform a Clean Boot

You may perform a clean boot to find out which particular software/application is causing this error and uninstall that with the help of the following steps:

a. Open System Configurations by typing MSConfig in the Windows search box.

b. Go to the Services tab, select Hide all Microsoft Services, and then click Disable All. (See Image 8)

Image 8: Hide all Microsoft services

c. Go to Startup and then click Open Task Manager. (See Image 9)

Image 9: Open Task Manager

d. Select the items from the screen that might be causing this error and click Disable. (See Image 10)

Image 10: Disable the corrupt startup item

e. Once done, exit the Task Manager and click OK on the Startup tab.

f. Restart the system in the clean boot environment.

g. Follow the instructions given on the screen and try uninstalling the problematic program/app (respectively).

h. After completing the process, reboot your system.

C:\Windows\system32\cmd.exe The directory name is invalid.

When you try to run Command Prompt or Notepad program, a different user on your system while logged in as Administrator by using Run as a feature, you may encounter the following error messages:

Here, you can see how to change Command Prompt Properties in the following steps:

Method 1: Change Command Prompt Properties

To resolve this error message, change the Command Prompt Properties or Notepad Properties. You may follow the given steps:

a. Type cmd in Windows search box, right-click on Command Prompt and choose Open file location. (See Image 11)

Image 11: Right-click on the ground and select Open file location

b. Right-click on Command Prompt and choose Properties. (See Image 12)

Image 12: Open Command Prompt Properties

c. Under the Shortcut tab, against Start inbox, change the value %HOMEDRIVE%%HOMEPATH% with a system-wide value such as %WINDIR%. Finally, click OK. (See Image 13)

Image 13: Change Values in Command Prompt Properties

d. Reboot the system and see if the error is fixed.

e. The directory name is invalid while playing DVD

Method 1: Run Hardware and Devices Troubleshooter

In this scenario, you may try to fix this issue by using ?Hardware and Device Troubleshooter?, a Windows? built-in utility to repair the errors with devices and hardware. Follow the given steps:

a. Open Settings and go to Update & Security. (See Image 14)

Image 14: Go to Update & Security

b. Select and open Troubleshoot. (See Image 15)

Image 15: Go to Troubleshoot

c. Choose Hardware and Devices. Now, click Run the troubleshooter. (See Image 16)

Image 16: Run Hardware and Device Troubleshooter

d. Once the process is finished, restart the Windows PC. Check if the error is solved.

Method 2: Disable then Enable the DVD/CD-ROM drives

You can try to fix this error by first disabling the DVD/CD-ROM drive and then enabling it with the help of the following steps:

a. Press Windows + X, locate Device Manager and open it.

b. Find the DVD/CD-ROM drive and expand it. Select the drive and right-click on it and click Disable device. (See image 17)

Image 17: Disable DVD/CD-ROM

c. Click Yes, go back to device drives, right-click on it and click Enable device.

The directory name is invalid while inserting an USB/HDD/SD Card

This error may occur with any external storage media devices such as USB, HDD, SSD, and SD Card etc. To fix this error, there are a few methods that you may use. You may run Device Troubleshooter as mentioned above. Other than that, you can run CHKDSK command or Update/Uninstall USB Controller Drivers.

Method 1: Plug the device in a different USB Port

Whenever you plug in any SSD, USB, HDD or any storage device to the system, and encounter this error, simply try to insert the device into another port. This may fix the issue indicating some problem in the port.

Method 2: Create partition with unallocated space

If the error still persists even after you plug in the device in a different port, you may consider creating a simple partition with unallocated space. According to a few users, this method helped them to fix the error.

a. Go to Disk Management and find the device that appears with unallocated space.

b. Right-click on the device, and click New Simple Volume (See Image 18).

Image 18: Select New Simple Volume

c. Follow the on-screen instructions, and once you are done, disconnect the device and re-connect it to check if it is working fine.

Method 3: Uninstall USB Controller Driver

The corrupt or incompatible USB controller driver may be the reason behind ?The Directory Name is Invalid in Windows 10? error. You may try to fix it by uninstalling the USB controller driver. Follow the given steps:

a. Go to Device Manager and then open Universal Serial Bus Controllers (See Image 19)

Image 19: Select Universal Bus Controllers

b. Select the corrupt Universal Serial Bus Controllers, right-click on it and click Uninstall. (See Image 20)

Image 20: Uninstall corrupt/faulty USB controller driver

c. Once the process is done, restart the PC and check if the problem is fixed.

Wrapping Up

The Directory Name is Invalid in Windows 10 error message may occur because of many reasons as we discussed in this post. You may solve this error with the methods such as run CHKDSK command, Perform a clean boot, Change Command Prompt /Notepad Properties, Uninstall USB Controller Drivers etc. However, while performing some of these methods, you may lose data. In that case, you may use Windows data recovery software such as Stellar Data Recovery. This Do-it-yourself software can get back your data from Windows PCs as well as external storage devices including USB, SSDs, HDDs, SD Cards, etc.

Related Post

Stellar Data Recovery

Trial Download is for Desktop or Laptop. Put your email id to receive the download link