Windows 11 refuses to copy, move, extract or delete a file, saying that its name or path is too long? The problem almost always comes from an old Windows limit: 260 characters for the full path of a file, folders included. This guide explains how to recognise it and work around it, from the simplest solution (shortening the path) to the tools built into Windows (subst and robocopy), then how to turn on long path support and what its limits are. The steps also apply to Windows 10.
Where the 260-character limit comes from
Microsoft documents that, in the Windows programming interface (Win32 API), the maximum length of a path is set by the MAX_PATH value, i.e. 260 characters. This total includes the drive letter, the colon, each backslash, the name of each folder, the file name and an invisible terminating character. On drive D, that leaves about 256 usable characters after D:\.
The limit applies to the full path, not to the file name alone. A file with a short name can therefore exceed it if it sits at the bottom of a long series of folders. Microsoft gives the example of a Git repository with long file names cloned into a folder that itself has a long name. Each element of the path (a folder or file name) is also limited, most commonly, to 255 characters.
Observe before acting
| What you see | Likely cause | Step |
|---|---|---|
| The error appears when copying or extracting to an already deep folder (Desktop, Documents, OneDrive, cascading subfolders) | The destination folder adds too many characters | Step 1 |
| You need to open, rename or delete a file located deep in a folder tree | The existing path already exceeds the limit | Step 2 |
| You need to copy or move a whole large folder tree | File Explorer stumbles on the deepest files | Step 3 |
| A nested folder refuses to be deleted, even after shortening | Folder tree too deep | Step 4 |
| A specific program reports a path too long | Long path support turned off in Windows | Step 5 |
If the message says a file is too large for a USB stick, rather than a path being too long, it is a different problem: see Fichier de plus de 4 Go impossible à copier sur une clé USB : FAT32 et solutions.
Step 1: shorten the path
When to use it: in most cases, especially when copying or extracting an archive.
Expected result: the operation completes without error, because each file now has a shorter full path.
Shortening a parent folder shortens the path of every file it contains in one go. It is often faster than renaming files one by one.
Step 2: reach a deep folder through a drive letter (subst)
When to use it: you cannot rename the parent folders, but you need to reach files located deep in the folder tree.
The subst command, built into Windows, associates a virtual drive letter with a folder. The path seen by programs then becomes much shorter.
Expected result: the files can be reached from Z: with a much shorter path, and the operations succeed.
Removing the virtual drive does not delete any file: only the drive letter shortcut disappears. Microsoft states that some commands, including chkdsk and format, must not be used on a drive created with subst.
Step 3: copy or move a folder tree with robocopy
When to use it: you need to copy or move a whole folder containing paths that are too long, and File Explorer stops partway.
The robocopy tool, included with Windows, supports paths longer than 256 characters by default: its documentation even provides a /256 option to turn this support off.
Expected result: robocopy copies the whole folder tree, including files whose paths are too long for File Explorer, then shows a summary of copied, skipped and failed files.
The /e option copies subfolders, including empty ones. Check the order of the two paths carefully: the first is the source, the second the destination.
Step 4: delete a nested folder that is too deep
When to use it: a folder refuses to be deleted because of paths that are too long, and steps 1 and 2 were not enough.
This method uses robocopy with the /mir option, which makes one folder identical to another, deleting from the destination everything that does not exist in the source. By choosing an empty folder as the source, the destination is emptied. A mistake in the destination path deletes the wrong files: copy the command carefully.
Expected result: the folder's content is deleted, then the folder itself. Files deleted this way do not go through the Recycle Bin.
Step 5: turn on long path support
When to use it: a specific program reports a path too long, and its publisher states that it supports Windows long paths.
Since Windows 10 version 1607, Microsoft has removed the MAX_PATH limit from many file functions, but only for applications that declare it (longPathAware element in their manifest) and only if a system setting is turned on. Microsoft insists that this setting only affects applications that have been modified to take advantage of it, not all applications. So it does not make the error disappear in every program.
Expected result: compatible programs accept paths longer than 260 characters. For the others, go back to steps 1 to 4.
On Pro and Enterprise editions, the same setting exists as a Group Policy: Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths (in a French-language Group Policy Editor, the labels are translated).
Special cases and rolling back
| Situation | What you need to know |
|---|---|
| Going back to the original setting | Turn off Enable long paths in Settings, or run the step 5 command again with the value 0 instead of 1, then restart. |
| The option is greyed out or switches back on its own | On a PC managed by a company or school, a policy may enforce this setting. Contact the administrator. |
| You deleted the wrong content with robocopy /mir | The files are not in the Recycle Bin. Restore them from your backup or File History, if you have one. |
| You cannot change the folder because of an "Access denied" message | This is not a path length problem but a permissions problem. |
| The Recycle Bin refuses to empty | See Corbeille qui ne se vide pas sous Windows 11 : solutions (French guide). |
To avoid this problem in the future
- Keep folder names short for deep folder trees (backups, projects, downloaded archives).
- Extract archives into a folder close to the root of the drive, then move only what you need.
Final check
- ☐ You have identified the operation that fails (copy, extraction, deletion or a specific program).
- ☐ The path has been shortened, or the work was done from a subst drive.
- ☐ The subst virtual drive was removed with /d once the work was done.
- ☐ robocopy copies were checked with a dry run (/l) before the real command.
- ☐ If you turned on long paths, the PC was restarted.
Sources
- Microsoft: Maximum Path Length Limitation
- Microsoft: Advanced Windows Settings
- Microsoft: robocopy
- Microsoft: subst
- Microsoft: New-ItemProperty
Still having the problem?
Reply in this topic with your Windows version (Settings > System > About), the operation that fails, the exact text of the error message, the program used and the approximate number of characters in the path. Replace your user name and personal folder names with generic names before posting.