The directory name is invalid error is a system issue, which can prevent you from opening certain files or directories. Also, you cannot access the storage devices, including SD card, external hard drive, USB flash drive, etc. To access your files and drive, you can see below and learn to fix this issue.
The directory name is invalid –how to fix accordingly?
The directory name is invalid in CMD
You will receive this error when you start CMD with a different user using Run as feature. To fix it, you can try to change the Start in value in the Command Prompt Properties dialog box.
Step 1. Type cmd in the search box, right-click Command Prompt, and then select Open file location.
Step 2. Right-click Command Prompt and select Properties from its context menu.
Step 3. In the Start in box, change the value from %HOMEDRIVE%%HOMEPATH% to a system-wide value such as %WINDIR%.
The directory name is invalid Windows 10 in DVD drive
When you try to play a DVD disc on your computer, you may encounter this error. To fix it, you can try to disable DVD drive or repair Windows Essentials.
1. Disable DVD drive.
Step 1. Press Win + X and select Device Manager from the list.
Step 2. Expand DVD/CD-ROM drives, right-click your drive and select Disable device.
Step 3. Click Yes to confirm that you want to disable the DVD drive.
Step 4. Find your DVD drive and enable it.
2. Repair or Remove Windows Essentials
Step 1. Click Start > Settings > Apps subsequently and then select Windows Essentials from the following list.
Step 2. Click the Repair or Uninstall button and follow the instructions to finish all the steps.
The directory name is invalid in SD card/external hard drive/USB
When you plug the SD card, external hard drive or SD card into your computer and try to clean install Windows 10 or upgrade your computer from the previous version of operating system to Windows 10, you may encounter this error as well.
See below and I will show you 3 suggestions. You can try it one by one.
1. Plug your device with a different USB port.
2. Create a new simple partition with unallocated space.
Step 1. Press Win + R to summon the Run window, type diskmgmt.msc in the box and press OK to open Disk Management.
Step 2. Right click the unallocated space and select New Simple Volume.
Step 3. Follow the instructions on the pop-up New Simple Volume Wizard and finish the rest of steps.
Step 4. Try to access your drive again.
3. Check disk errors with Properties.
Step 1. You can open This PC, right-click the hard disk in the event of problems and select Properties from the context menu.
Step 2. Click Tools tab and hit Check Option under the Error checking. It will check your disk if there are some disk errors.
Step 3. Click Scan and repair drive and then restart your computer.
4. Update the disk driver with Device Manager.
Step 1. Type devmgmt.msc in the Run window and press OK to open Device Manager.
Step 2. Expand Disk drives, right-click on your device and select Update driver.
The directory name is invalid in Task Scheduler
If you have this issue with Task Scheduler, you may add quotes in the file path. You can try to remove quotes in the file path and save changes. And then, see if your problem is solved.
Besides, if you have a system restore point, you can restore from a system restore point. It will restore your computer to a previous working state.
How to protect your files in Windows 7/8/10?
The directory name is invalid is a system error in Windows 7/8/10, which will not allow you to access your SD card, external hard drive, USB flash drive, DVD, etc. To reduce data loss, you need to create a backup for your important files or folders and save it to a safe place.
Before you start to backup files, you need to prepare two things.
1. A storage device to save your files and folders. You can use the external hard drive, USB drive, cloud drive like Dropbox, Google Drive, etc.
2. A backup and restore software. This is very important. A proper software can make everything simple. I recommend you free backup and restore software AOMEI Backupper. With it, you can backup files with certain file extension, backup large files, backup files to the external hard drive, backup files to Google drive, etc.
Start with the detailed steps.
Step 1. Download free backup and restore software – AOMEI Backupper Standard, install and launch it. And then, click File Backup under the Backup tab.
Step 2. Click Add File or Add Folder. Here, I’ll take Add Folder as an example.
Step 3. Click Browse to find and select folders and then click Open to add a folder.
As you can see from above, there is a feature called Filter settings which can help you backup files with certain file extension. However, this feature is only available on the paid version, such as, AOMEI Backkupper Professional, AOMEI Backupper Server. If it’s essential, you can upgrade the backup software.
Step 4. Click Step 2 to select a path for your computer. You can choose to backup files to external hard drive, USB flash drive, NAS, etc. And then, click Start Backup to start the pending operation.
Note: If you want to backup files on a regular basis, you can tick Schedule > General or Advanced in order and then select one of the settings from the tab.
No matter what storage device you use, you can fix the directory name is invalid error. One more thing, file backup is very important. With a file backup in hand, you can restore files from backup at any time.