5 Ways to Fix the ERROR_INVALID_NAME

First, check the file and directory name to understand the problem

Reading time icon 5 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Ways to fix ERROR_INVALID_NAME

The ERROR_INVALID_NAME typically occurs in Windows systems when an app or operation encounters a file or directory name that is not valid.

First, determine when the error occurs, whether during file operations, application installation, or any other action. Then, closely check the error message, which can tell you about the file or directory causing the issue.

How can I get rid of the ERROR_INVALID_NAME?

1. Check file/directory name

Windows doesn’t allow certain characters in file or directory names, including \ / : * ? ” < > | so make sure you don’t use any of these. Also, refrain from using reserved names like CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9.

If you can access the file/directory, right-click it, choose Rename, and remove invalid characters or reserved names. Also, ensure the total path length is less than 260 characters.

2. Check the permissions

  1. Right-click the problematic drive or file and select Properties from the context menu.
  2. Go to the Security tab. You will see a list of groups and user names that have permission to access the drive or file. Look for your user account or the group you belong to and select it.
  3. Now, under Permissions for (User Account Name), you will see:
    • Full Control: Complete control over the file/folder.
    • Modify: Allows you to edit and delete the file/folder.
    • Read & Execute: View and execute file but can’t modify/delete it.
    • Read: Can only view the file/folder.
    • Write: Can add files & subfolders but not delete existing ones.
  4. If you need to change permissions, you can click the Edit button.Edit
  5. On the Permissions window, find your user account in the list, and check or uncheck the Permissions that you want to change. If you select Full Control to give complete control over the file, then click Apply, then OK to save the changes.ERROR_INVALID_NAME - app permissions
  6. Click OK to close the window.

If you don’t see your user account in the list of groups and user names, you need to add it. For that, follow these steps:

  1. In the Permissions window, click the Add button.
  2. In the Enter the object names to select field, enter the user name and click Check Names to validate it.
  3. After adding your account, it will appear in the list; then you can set the desired permissions.
  4. Once done, click Apply and OK twice to save the changes.

If you face any other issues related to file permissions such as files not inheriting permissions from parent folder; you can check out this detailed guide.

3. Using the Command Prompt

  1. Press the Windows key, type cmd in the search box, and click Open.cmd - ERROR_INVALID_NAME
  2. Ensure you copy the file path you want to rename, as you need to navigate to the folder or file you want to rename.
  3. If you need to change the directory, type the name of the drive with a colon and hit Enter: E:
  4. Copy & paste the following command after replacing C:\Users\YourUsername\Documents with the file path you copied and press Enter: cd "C:\Users\YourUsername\Documents"
  5. Type the following command to list all files and folders in the drive, then hit Enter: dirDIR command
  6. From the list, note down the exact name of the file you want to rename, copy & paste the following command after replacing OldName.ext with the existing file name with extension and NewName.ext with the name you want to use and press Enter: ren "OldName.ext" "NewName.ext"

4. Run the SFC scan

  1. Press the Windows key, type cmd in the search box, and click Run as administratorCMD elevated ERROR_INVALID_NAME
  2. Type the following command to restore the missing system files and press Enter: sfc /scannowSFCSCANNOW CMD
  3. The scan will start looking for missing Windows system files and try to repair them.
  4. Once done, restart your computer to let the changes take effect.

Running the SFC scan can also help you fix the ERROR_WAIT_NO_CHILDREN 128 (0x80); read this guide to learn more.

5. Using the Safe mode

  1. Press Windows + R to open the Run window.  Safe boot ERROR_INVALID_NAME
  2. Type msconfig and click OK to open the System Configuration window.
  3. Go to the Boot tab, and under Boot options, select Safe boot, then place a checkmark next to Network.Safe boot - ERROR_INVALID_NAME
  4. Click Apply, then OK to save the changes.
  5. Click Restart.Restart  ERROR_INVALID_NAME

Your computer will restart in safe mode with networking, allowing you to connect to the Internet while only allowing essential functionality. Try renaming the file.

6. Check for Windows Updates

  1. Press Windows + I to open the Settings app.
  2. Go to Windows Update, and click Check for Updates.Windows Update Check for updates ERROR_INVALID_NAME
  3. If an update is available, click Download & install to update your Windows version.

In conclusion, to fix the ERROR_INVALID_NAME, validate the file or drive name, check the file’s permissions, use Command Prompt to rename the file, run the SFC scan to restore missing files, or use Safe mode.

Did we miss a step that helped you fix the issue? If so, share it with our readers in the comments section below. We will add it to the list.

More about the topics: Windows 11

User forum

0 messages