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.
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)
b. Go to Local Disk, right-click on it and select Properties (See Image 3)
c. Now, go to the Tools tab and click Check. (See Image 4)
d. Click Scan Drive (See Image 5).
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)
b. In the open window, type chkdsk /f /r d: and hit Enter. (See Image 7)
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)
c. Go to Startup and then click Open Task Manager. (See Image 9)
d. Select the items from the screen that might be causing this error and click Disable. (See Image 10)
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:
- C:\Windows\system32\cmd.exe The directory name is invalid.
- C:\Windows\system32\Notepad.exe The directory name is invalid.
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)
b. Right-click on Command Prompt and choose Properties. (See Image 12)
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)
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)
b. Select and open Troubleshoot. (See Image 15)
c. Choose Hardware and Devices. Now, click Run the troubleshooter. (See Image 16)
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)
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).
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)
b. Select the corrupt Universal Serial Bus Controllers, right-click on it and click Uninstall. (See Image 20)
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.
Thank you for the post. I Tried out the method 2 suggested by you in the blog and it works. Thanks for sharing
Thank you for this blog! I did try the very first method suggested by you, and it fixed the problem AND saved what was on my memory card. After connecting the memory card, i right clicked on it and chose Properties, then Tools, then Check under Error Checking. It worked like a charm! 🙂
Hi Chuck,
Its glad to know that you like our article. Keep liking our post and do subscribe us on our youtube channel for more updates.