Windows

The Filename or Extension Is Too Long: How to Fix It in Windows

By ··Updated September 18, 2026·4 min read
What this guide covers
  1. Where the limit comes from
  2. Quick fixes
  3. 1. Shorten the path by moving the folder
  4. 2. Rename folders along the way
  5. 3. Use a mapped drive
  6. 4. Use a tool that supports long paths
  7. The proper fix: enable long paths
  8. With Group Policy (Pro, Enterprise, Education)
  9. With the registry (all editions, including Home)
  10. The catch
  11. Deleting a file you cannot delete
  12. Avoiding it in future
  13. Frequently asked questions
  14. What is the actual limit?
  15. Why can one program open the file but Explorer cannot?
  16. Is enabling long paths risky?
  17. Does this affect network drives too?
  18. The error mentions a filename, but mine is short.

“The filename or extension is too long” is Windows hitting a limit that has been in place since 1985: a full path — drive, every folder, the file name and the extension — cannot exceed 260 characters.

The quickest workaround is to move the item nearer the root of the drive so the path gets shorter. The proper fix is to turn on long path support, which Windows has had since 2016 but still leaves off by default.

Windows showing the error the filename or extension is too long
The message appears when copying, extracting or deleting deeply nested files.

Checked August 2026. Applies to Windows 11 and Windows 10 22H2. Note that Windows 10 left support on 14 October 2025.

Where the limit comes from

MAX_PATH is 260 characters, and that counts everything:

C:\Users\yourname\Documents\Projects\2026\Client\Assets\Images\Exports\final-v3.png
^-- all of this counts, including the backslashes

It is easy to exceed by accident. Node.js projects, extracted archives that were built on Linux, and OneDrive folders synced from a machine with a longer user name all get there routinely.

The confusing part is that the file often exists and can be opened by the application that made it — it is File Explorer and older tools that refuse to touch it, because they use the old API.

Quick fixes

1. Shorten the path by moving the folder

The fastest way out. Move the top folder to somewhere short:

C:\temp\

Every file inside instantly loses dozens of characters of prefix. Do what you needed to do, then move it back — or leave it there.

2. Rename folders along the way

You cannot rename what you cannot reach, but you can usually rename a folder higher up. Shortening one folder name from Client Project Assets Final to cpa can bring an entire tree back under the limit.

3. Use a mapped drive

This is the trick worth knowing. Map a deep folder to its own drive letter and the path restarts from that letter:

subst X: "C:\Users\yourname\Documents\Projects\2026\Client\Assets"

Now X:\Images\Exports\final-v3.png is well within the limit. To remove it afterwards:

subst X: /d

4. Use a tool that supports long paths

7-Zip and Robocopy both handle paths beyond 260 characters. To copy a problem folder:

robocopy "C:\long\source\path" "C:\temp\dest" /E

The proper fix: enable long paths

Windows 10 version 1607 and later support paths up to about 32,767 characters — but the setting is off by default for compatibility with older software.

With Group Policy (Pro, Enterprise, Education)

  1. Press Win + R, type gpedit.msc, press Enter.
  2. Go to Computer ConfigurationAdministrative TemplatesSystemFilesystem.
  3. Open Enable Win32 long paths and set it to Enabled.
  4. Restart.

With the registry (all editions, including Home)

Take a restore point before editing the registry.

From an elevated PowerShell:

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name LongPathsEnabled -Value 1 -Type DWord

Restart afterwards.

The catch

Enabling long paths does not make every program cope with them. Applications have to declare support, and many older ones never will. In practice:

  • Works: modern PowerShell, Windows Terminal, most current development tools, File Explorer for most operations.
  • Still fails: older 32-bit applications, some installers, plenty of legacy line-of-business software.

Turn it on — it removes a whole class of problems — but do not be surprised when one old program still objects.

Deleting a file you cannot delete

A file with too long a path can refuse to be deleted through File Explorer. Robocopy has a well-known trick: mirror an empty folder over it.

mkdir C:\empty
robocopy C:\empty "C:\path\to\stubborn\folder" /MIR
rmdir C:\empty
rmdir "C:\path\to\stubborn\folder"

/MIR makes the destination match the source exactly — which, with an empty source, means deleting everything in the destination. Check the destination path twice before pressing Enter. There is no undo and nothing goes to the Recycle Bin.

Avoiding it in future

  • Keep working folders near the root: C:\dev\, C:\work\.
  • Avoid dates, client names and version numbers repeated at every level.
  • Watch out for extracting an archive inside the folder it downloaded to, which doubles the nesting in one step.
  • On OneDrive, remember the local path includes your full OneDrive folder name before anything else.

Frequently asked questions

What is the actual limit?

260 characters for the full path under the classic API. With long paths enabled, roughly 32,767 — though individual file and folder names are still capped at 255 characters each.

Why can one program open the file but Explorer cannot?

Programs that use the modern API, or that prefix paths with \\?\ internally, are not subject to the 260-character limit. Ones using the old API are.

Is enabling long paths risky?

It is a supported Windows setting and is safe. The only downside is that some older applications will not benefit, and a very small number behave oddly when they encounter a path they cannot represent.

Does this affect network drives too?

Yes, and UNC paths (\\server\share\...) start from a longer prefix, so they hit the limit sooner. Mapping the share to a drive letter is the usual workaround.

The error mentions a filename, but mine is short.

The message is about the whole path, not the file name alone. A twelve-character file name at the end of a 255-character folder tree still exceeds the limit.

Found a step that no longer matches?

Tell us which version of Windows, the browser or the app you are running — that is what makes a correction usable. Your email address is not published.