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 that prevents access to certain files, directories, and storage devices like SD cards, external hard drives, USB flash drives, and DVDs.

The Directory Name Is Invalid

To resolve the issue with accessing your files and drive, follow the steps provided and then back up your files. This will ensure that your data is safe in case of any errors.

The directory name is invalid – how to fix it accordingly

FIX 1: Change Start in value in command prompt properties

When using the "Run as" feature to start CMD with a different user, you may encounter the error "the directory name is invalid in CMD". To resolve this issue, you can modify the Start in value in the Command Prompt Properties dialog box.

Step 1. To open the Command Prompt, type "cmd" in the search box, right-click on "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 trying to play a DVD disc on your computer, you may encounter the error "the directory name is invalid in Windows 10 DVD drive". To resolve this issue, you can try disabling the DVD drive.

Step 1. To access the Device Manager, press the Windows key + X on your keyboard, and from the menu that appears, select Device Manager. This will open the Device Manager window, where you can view and manage the hardware devices connected to your computer.

Step 2. Expand DVD/CD-ROM drives, right-click your drive and select Disable device.

The Directory Name Is Invalid DVD

Step 3. To confirm that you want to disable the DVD drive, click Yes.

Step 4. Find your DVD drive and enable it.

You can try to repair or remove Windows Essentials by going to Start > Settings > Apps > Windows Essentials, then clicking the Repair or Uninstall button to start the process.

FIX 3: Plug your device with a different USB port

When trying to install or upgrade Windows 10 using an SD card, flash drive, or external hard drive, you may encounter the error "the directory name is invalid" due to a corrupted or improperly formatted storage device. This issue can occur when the storage device is not properly prepared or is damaged, causing the installation process to fail.

If you're experiencing an error with your device, it's possible that the issue lies with a dead USB port. Try plugging your device into a different USB port to see if that resolves the problem.

FIX 4: Create a new simple partition with unallocated space

This directory name error may occur when trying to access a USB drive or external storage devices, but creating a new simple partition with unallocated space may resolve the issue.

Step 1. To open Disk Management, press the Windows key + R to open the Run window, then type "diskmgmt.msc" in the box and press OK. This will open the Disk Management window.

Step 2. Right click the unallocated space and select New Simple Volume.

Create New Simple Volume

Step 3. To create a new simple volume, follow the on-screen instructions provided by the New Simple Volume Wizard. This will guide you through the process of setting up a new volume, including selecting a drive letter and assigning it to the new volume.

Step 4. Try to access your drive again.

FIX 5: Check disk errors with Properties

If the disk encounters issues, you may get a "the directory name is not valid" error with external storage devices. To troubleshoot, you can check the disk's properties to see if there's a problem.

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. To check for disk errors, click the "Tools" tab and select "Check" under "Error checking" in the "Error checking" section. This will scan your disk for any potential 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. To open Device Manager, type devmgmt.msc in the Run window and press OK.

Step 2. To update the driver for your disk drive, expand the Disk drives section in the Device Manager, right-click on your device, and select Update driver from the context menu.

Update Drivers

FIX 7: The directory name is invalid in Task Scheduler

If you're experiencing issues with Task Scheduler, try adding quotes to the file path, or remove any existing quotes and save the changes to see if the problem is resolved.

If you have a system restore point, you can restore your computer to a previous working state by using the system restore feature. This will undo any recent changes that may have caused the issue.

How to protect your files in Windows 7/8/10/11

If you're getting the "directory name is not valid" error in Windows 7/8/10/11, it might be blocking access to your SD card, external hard drive, network drive, or DVD. This can also prevent you from accessing files on these devices. To resolve this, consider backing up your important files or folders to a secure location. This will help prevent data loss in case the issue persists.

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 an external hard drive, a USB drive, or cloud storage services like Dropbox or Google Drive.

2. A backup and restore software. A proper software can make everything simple, and I recommend using Qiling Disk Master, a free backup and restore software that allows you to ackup files with certain file extension, backup large files, and backup files to external hard drives or Google Drive, among other features.backup files with certain file extension, backup large files, and backup files to external hard drives or Google Drive, among other features.

Start with the detailed steps.

Step 1. Download free backup and restore software - Qiling Disk Master Standard, install and launch it. Then, click "File Backup" under the Backup tab.

File Backup

Step 2. To add a folder, click on the "Files" or "Folders" option, and then select "Folder" as the example.

Files Folder

Tip: To exclude specific files from a folder's backup, use the Filter Settings, accessible via the funnel icon on the folder's right side. This feature is only available in paid versions, such as Qiling Disk Master Professional or Server, so consider upgrading if necessary.

File Backup Funnel

Step 3. To proceed, select a path for your computer's backup, such as an external hard drive, USB flash drive, or network-attached storage (NAS), and then click "Proceed" to initiate the pending operation.

Select Destination

✎ Notes:

Wrapping things up

You can fix the "directory name is invalid" error regardless of the storage device you're using by following the above methods. Additionally, creating a file backup with Qiling Backkupper is crucial to prevent data loss, and having a backup allows you to restore files from backup at any time.

If you have multiple computers, you can consider using Qiling Disk Master Tech or TechPlus, which allows you to deploy an image to unlimited computers using its 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!