Quick answer for advanced users
Run chkdsk /f X: (replace X with your drive letter) from an admin Command Prompt. That fixes most cases. If not, check the file name for illegal characters like \ / : * ? " < > | or a trailing space.
What's going on here?
Error 0xC00D001C (NS_E_INVALID_NAME) pops up when Windows tries to open a file or folder but can't parse the path. I've seen this on USB drives that were yanked out mid-write, on old NTFS volumes with bad sectors, and even on network shares where a client's NAS got corrupted. The error text says "The file name, directory name, or volume label syntax is incorrect" — but it's not always a typo. More often it's the directory index (the $MFT in NTFS) that's gone sour, tricking Windows into thinking a name is invalid.
I had a client last month whose entire shared drive locked up because a temp file had a null character in its name. Took me 20 minutes to find it with a hex editor. But in most cases, you don't need to go that deep.
Step-by-step fix
- Run CHKDSK first — Open Command Prompt as admin. Type
chkdsk /f D:(replace D with your drive letter). Let it finish. This fixes the corrupt index 90% of the time. - Reboot and test — After chkdsk, restart Windows and try accessing the file again. If it works, you're done.
- Find the bad file — If chkdsk didn't help, open File Explorer and sort files by name. Look for files with weird characters: trailing spaces, dots at the end, or symbols like
?or*. Rename or delete them. - Use command line to rename — For stubborn files, open Command Prompt in the folder and use
ren "oldname.txt" "newname.txt". If the name has spaces or odd chars, put it in quotes. Windows might let you rename from cmd even when Explorer refuses. - Check volume label — Right-click the drive in Explorer, Properties, and make sure the volume label has no invalid chars (spaces are fine, but no colons, slashes, or stars).
Alternative fixes if steps 1-5 fail
- Use a live Linux USB — Boot from Ubuntu or similar. Linux often bypasses Windows' name parsing bugs. Mount the drive and copy the files to another folder, then back to Windows. I've done this dozens of times.
- Run SFC and DISM — Rare but possible: system files are corrupted. Open cmd as admin, run
sfc /scannow, thenDISM /Online /Cleanup-Image /RestoreHealth. - Try third-party tools — Tools like Hiren's Boot CD or MiniTool Partition Wizard can fix index corruption without losing data. Use them only if chkdsk can't run.
- Backup and reformat — If nothing works and the data isn't critical, copy what you can, then reformat the drive. This wipes the index clean. Quick format is fine if no bad sectors.
Prevention tip
Don't yank USB drives without safely ejecting. Even one bad dismount can corrupt the MFT entry for a file. Also, avoid using characters like \ / : * ? " < > | in file names — Windows disallows them by default, but some apps (especially old ones) sneak them in. I set up a group policy on client servers to block file names with trailing spaces or dots. Saves headaches later.
If you're on a network share, check the NAS's file system integrity every few months. Most consumer NAS boxes run ext4 or Btrfs, but SMB translation can still throw this error.