Skip to main content
FixMyTech

Why Windows Says My File Name Is Too Long

By

Published

7 min read

Share

Short answer

The limit is on the entire path, not the file name — Windows caps it at 260 characters including the drive letter and every folder in between. Move the parent folder closer to the root, such as C:\temp, and the operation succeeds immediately. On Windows 10 version 1607 and later you can remove the limit entirely with a registry or Group Policy setting.

On this page

Windows refuses to copy, move or delete a file and tells you the name is too long. You look at the file name. It is Report.docx.

The message is misleading. The limit applies to the complete path — the drive letter, every folder between it and the file, and the file name itself — and Windows caps that at 260 characters. A short file name at the bottom of a deep folder tree breaches it easily.

This is a constraint inherited from the earliest versions of Windows, and although modern Windows can work past it, the setting is off by default and plenty of software still cannot cope.

What counts towards the 260

Everything. Here is a path that fails, at 268 characters:

C:\Users\jennifer\OneDrive - Northfield Partnership LLP\Shared Documents\
Client Work\2026\Q3 Regulatory Review\Working Papers\Draft Submissions\
Reviewed by Compliance\Final Versions\Appendix C Supporting Evidence\
Scan 2026-09-04 14-22-07.pdf

Nothing in it is unreasonable in isolation. The organisation name costs 38 characters before any work begins, the user profile path costs another 17, and eight nested folders with descriptive names do the rest.

Breaking down a typical path:

Component Characters
C:\Users\username\ 15–25
OneDrive or SharePoint sync prefix 30–90
Project and year folders 20–40
Working subfolders 50–120
The file name itself 10–60

The sync prefix is why this problem is so much more common now than it was ten years ago.

The quick fixes

In order of how fast they are.

Move the folder higher. Cut the problem folder and paste it into C:\temp or directly onto the drive root. The path collapses, the operation works, and you can move it back afterwards if you shorten names in the meantime. This resolves most cases in under a minute.

Map a network drive to a deep subfolder. Right-click the subfolder, use the sharing options, or run:

subst X: "C:\Users\jennifer\OneDrive - Northfield Partnership LLP\Client Work"

Everything below that folder is now reachable as X:\, which saves 60-odd characters. Run subst X: /d to remove it when finished.

Rename folders in the middle. Q3 Regulatory Review becoming Q3 saves 18 characters. Working upward from the file, shortening two or three folder names usually brings a path back under the limit. Beware that renaming a folder that is syncing will propagate the change to everyone else using it.

Use 7-Zip’s file manager. It addresses long paths directly and will delete or move files that File Explorer cannot touch. Open 7-Zip File Manager, navigate to the folder, and operate from there.

Removing the limit properly

Windows 10 version 1607 and later support paths beyond 260 characters, but the support is opt-in.

Via Group Policy, on Pro and Enterprise

  1. Press Win+R, run gpedit.msc.
  2. Navigate to Computer Configuration → Administrative Templates → System → Filesystem.
  3. Open Enable Win32 long paths and set it to Enabled.
  4. Restart.

Via the registry, on any edition

Registry edits can damage a Windows installation if you change the wrong value. Change only the value named below, and nothing else in that key.

  1. Press Win+R, run regedit, and accept the prompt.
  2. Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  1. Find LongPathsEnabled. If it is not there, right-click → New → DWORD (32-bit) Value and name it exactly that.
  2. Set its value to 1.
  3. Restart the computer.

What this does and does not do

File Explorer, PowerShell and modern applications will then handle long paths. Older programs that were compiled without declaring long-path support will not, and will produce the same error as before. The setting does not change their behaviour because the limitation is inside them.

So this fixes the problem for Windows itself whilst leaving some of your software exactly where it was. It is still worth enabling, but it is not the universal fix it sounds like.

Deleting a file you cannot delete

The particularly annoying case: the file exists, Explorer will not remove it, and you cannot shorten the path because renaming the folder also fails.

Robocopy handles it. Create an empty folder, then mirror it over the problem folder:

mkdir C:\emptyfolder
robocopy C:\emptyfolder "C:\path\to\problem\folder" /MIR

This deletes everything inside the target folder. /MIR makes the destination match the source exactly, and the source is empty. Check the target path twice before pressing Enter, and never point it at anything you have not confirmed you want emptied.

Remove the now-empty folder normally afterwards.

Avoiding it in the first place

The structural fix is shorter paths, which mostly means fewer levels of folders rather than cryptic names.

  • Keep the tree shallow. Four or five levels is enough for almost anything. Deeply nested structures are also harder to navigate, which is the real cost.
  • Use dates in file names, not folders. 2026-09-04 Client Review.docx in one folder beats 2026\September\04\Client Review.docx across four.
  • Watch what SharePoint sync does. Sync the specific library you need rather than the whole site. Every unnecessary level in the sync root is charged against every file below it.
  • Avoid letting software name things. Scanner output, camera exports and export tools generate names like Scan_2026-09-04_14-22-07_Document_Page_001.pdf which is 48 characters doing the work of about 15.

If you are tidying up a OneDrive folder for this reason, it is worth knowing that OneDrive filling up your C drive is a related and separate problem with its own causes.

What to expect

Moving the folder to C:\temp resolves this immediately in nearly every case, and is the right first move when you are mid-task and need the file now. The registry or Group Policy change is the right permanent fix on a machine where this keeps happening.

The limitation you cannot work around is third-party software. A program that does not support long paths will keep failing regardless of the Windows setting, and that includes some backup tools, some older Office versions, and a surprising amount of line-of-business software. For those, the only answer is shorter paths — which is why the structural advice above matters more than the registry key.

Frequently asked questions

What is the actual character limit in Windows?
260 characters for the full path, made up of the drive letter and colon, a backslash, up to 256 characters of folder and file name, and a terminating null character. Individual folder and file names are separately limited to 255 characters, but the full path limit is what you hit in practice.
Why can I create the file but not delete it?
Because a path can become too long after creation, usually when a folder higher up is renamed to something longer or the whole tree is moved deeper. File Explorer then cannot address the file to delete it, even though the file system holds it quite happily.
Does enabling long paths break anything?
The setting itself is safe and supported, but it only helps applications that have declared support for long paths. File Explorer and PowerShell handle them, whilst many older programs do not and will still fail with the same error. Nothing is damaged either way.
Why does this happen so much with OneDrive and SharePoint?
Because syncing adds a long prefix to every path. A SharePoint library syncs to a local folder named after the organisation and the site, which can consume 80 or more characters before any of your own folders are counted, leaving far less room than you had on the server.
Can I use a tool to delete files with long paths?
Yes. Robocopy can mirror an empty folder over the problem folder to clear it, 7-Zip's file manager addresses long paths directly, and mapping a network drive to a deep subfolder shortens the path enough for Explorer to work. All three avoid the Explorer limitation rather than removing it.

All Office guides