Quick Answer
Enable long paths in the registry and set the LongPathsEnabled value to 1, then reboot. If that fails, you need to find the offending file or registry key and shorten its path.
Why This Happens
You'll usually see STATUS_NAME_TOO_LONG (0xC0000106) when running an installer, copying files, or sometimes when a program tries to create a file. The system is hitting the old 260-character MAX_PATH limit. Windows has had a long path support option since Windows 10 1607, but it's off by default. I've seen this crop up in all sorts of places—last month a client couldn't install a printer driver because the driver package was buried in a temp folder with a ridiculously long path.
The error isn't just about files, though. It can also happen with registry keys that have long names. The fix is usually simple, but the tricky part is finding what's too long.
The Main Fix: Enable Long Paths
- Open Registry Editor – Press Win + R, type
regedit, hit Enter. - Go to the right key –
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem - Find or create
LongPathsEnabled– If it's not there, right-click the FileSystem key, select New > DWORD (32-bit) Value, and name itLongPathsEnabled. - Set it to 1 – Double-click the value, change the base to Decimal, and set the data to
1. - Reboot – Restart your PC for the change to take effect.
This works for most file-related cases, especially if you're using a 64-bit system. Note: some older 32-bit apps still won't respect it, so if the error persists, move to the next step.
If That Doesn't Fix It: Find the Long Path
Sometimes the error is specific to a file or folder that's already too long. Here's how to track it down.
Check the Error Message
If you're lucky, the error will mention a file path. Note it down. If it doesn't, look at what you were doing when it popped up. That's your starting point.
Use Robocopy to Find Long Paths
Open Command Prompt as administrator and run:
robocopy C:\ C:\temp\scan /L /E /XJ /R:0 /W:0 /LOG:C:\temp\scanlog.txtThis will scan your C drive and log any paths that are too long. The log will show files with NAME TOO LONG errors. You can adjust the source path to target a specific folder.
Shorten the Path
Once you find the file, either rename it or move it closer to the root (e.g., from C:\Users\John\Documents\Project Files\...\really-long-filename.doc to C:\Short\file.doc). If it's in a program's folder, you might need to reinstall the program to a shorter path.
When It's a Registry Issue
If the error happens when installing or uninstalling software, it could be a registry key that's too long. Tools like RegFromApp or Process Monitor can help you see which registry key is being accessed when the error occurs. But honestly, most of the time it's a file path, not a registry issue.
Alternative: Use Subst to Shorten Paths
If you can't move the file, you can map a drive letter to a long path using subst. Example:
subst X: "C:\Users\John\Documents\Really Long Folder Name\Subfolder"Then you can access the files as X:\filename, which is much shorter. But this only helps for manual access, not for installers that expect a specific path.
Prevention
The easiest way to avoid this is to keep your folder structure shallow. Don't create nested folders like Documents\Projects\ClientName\Website\Assets\Images\Final\Compressed. Also, when naming files, keep them under 50 characters—it forces you to be concise and helps everyone.
If you're a developer, you can also make your programs declare long path support in the manifest. But for most users, the registry fix is the way to go.
I had a client who couldn't install a VPN client because the installer was extracting to a temp folder with a 300-character path. Enabling long paths fixed it instantly. Don't waste time digging through logs first—try the registry tweak before anything else.
One last thing: if you're on Windows Server, the same registry fix applies. And if you're on Windows 10 or 11, make sure you're fully updated—older builds had bugs with long path support.