The Directory Name Is Invalid in Windows – Fixed with 7 Ways!  

The Directory Name Is Invalid in Windows – Fixed with 7 Ways!


Table of Contents
  1. What is "the directory name is invalid" error?
  2. The directory name is invalid – how to fix it accordingly
    1. FIX 1: Change Start in value in command prompt properties
    2. FIX 2: Disable DVD drive
    3. FIX 3: Plug your device with a different USB port
    4. FIX 4: Create a new simple partition with unallocated space
    5. FIX 5: Check disk errors with Properties
    6. FIX 6: Update disk drivers with Device Manager
    7. FIX 7: The directory name is invalid in Task Scheduler
  3. How to protect your files in Windows 7/8/10/11
  4. Wrapping things up

What is "the directory name is invalid" error?

"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, DVD, etc.

The Directory Name Is Invalid

To access your files and drive, you can see below and learn to fix this issue. Then, you are supposed to backup files. Only in this way, you can prevent data loss when error comes.

The directory name is invalid – how to fix it accordingly

FIX 1: Change Start in value in command prompt properties

You will receive "the directory name is invalid in CMD" when you start CMD with a different user using Run as feature. To fix it, you can choose 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.

The Directory Name Is Invalid CMD

Step 3. In the Start in box, change the value from %HOMEDRIVE%%HOMEPATH% to a system-wide value such as %WINDIR%.

FIX 2: Disable DVD drive

When you try to play a DVD disc on your computer, you may encounter "the directory name is invalid in Windows 10 DVD drive". To fix it, you can try to 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.

The Directory Name Is Invalid DVD

Step 3. Click Yes to confirm that you want to disable the DVD drive.

Step 4. Find your DVD drive and enable it.

Besides, you still can try to repair or remove Windows Essentials. You can go to Start > Settings > Apps > Windows Essentials, then click the Repair or Uninstall button to start the process.

FIX 3: Plug your device with a different USB port

When you plug the SD card, flash drive, external hard drive 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 "the directory name is invalid in SD card/USB/external hard drive".

For this error, the simplest reason is that your insert your device with a dead USB port. Thus, if you encounter the same error with external storage devices, you can try to plug your device with a different USB port first.

FIX 4: Create a new simple partition with unallocated space

This directory name error may occur when you try to access a USB drive or other external storage devices. In this case, you can consider creating a new simple partition with unallocated space. Some users report that this method works perfectly.

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.

Create 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.

FIX 5: Check disk errors with Properties

If the disk run into issues, you may receive "the directory name is not valid" error with external storage devices. If you are not sure that there is a problem with this disk, you can check it with its 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.

Check Disk Error

Step 3. Click Scan and repair drive and then restart your computer.

FIX 6: Update disk drivers 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.

Update Drivers

FIX 7: 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/11

If you receive the error "the directory name is not valid" in Windows 7/8/10/11, there is a possibility that you cannot access your SD card, external hard drive, network drive, DVD, etc. Also, you cannot access the files on theses devices. To avoid it, 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 Qiling Disk Master. 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 – Qiling Disk Master Standard, install and launch it. And then, click File Backup under the Backup tab.

File Backup

Step 2. Click Files or Folders. Here, I'll take Folder as an example.

Files Folder

Tip: If you do not want to backup all files in a folder, you can filter via the Filter Settings. You can go to it via the funnel shaped button at the right side of a folder. However, this feature is only available on the paid version, such as, Qiling Disk Master Professional, Qiling Disk Master Server. If it's essential, you can need to upgrade the backup software.

File Backup Funnel

Step 3. Click 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 Proceed to start the pending operation.

Select Destination

✎ Notes:

Wrapping things up

No matter what storage device you use, you can fix the directory name is invalid error with the above methods. One more thing, creating a file backup with Qiling Backkupper is very important to avoid data loss. With a file backup in hand, you can restore files from backup at any time.

If you have multiple computers, you can consider Qiling Disk Master Tech or TechPlus. It can help you deploy image to unlimited computers with the built-in tool Qiling Image Deploy.

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!