0

I am using a desktop application that reads/writes folders and files on the local filesystem.

PROBLEM: Some of these files have paths longer than 260 characters, triggering such errors:

PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Question: How to make Windows allow long paths?
I am using a wide array of Windows versions so I appreciate answers split by versions.

Different from Windows 10 "Enable NTFS long paths policy" option missing as that question is only about a missing option.

Nicolas Raoul
  • 10,711
  • 18
  • 64
  • 102
  • The question might be different but the answer still applies, and is in fact, nearly identical. Even uses the exact same screenshots. – Ramhound Jul 05 '17 at 11:12
  • Not a duplicate. That question is about a missing option. **The ideal answer over there would be just "It has moved to XYZ"**. It does not matter that for some reason some answerers over there went to great lengths to detail things irrelevant to its topic. – Nicolas Raoul Jul 05 '17 at 11:25

1 Answers1

2

First, check your Windows version. If you have Windows 10 (Version 1607 - Anniversary Update) or Windows Server 2016 or later, read the chapter below. If ealier, skip to the last chapter of this answer.

Windows 10 1607 or Windows Server 2016 or later

Open Computer Configuration > Admin Templates > System > FileSystem.

Override the Enable Win32 long paths group policy entry Enable Win32 long paths as seen below.

Depending on your Windows version it might be called Enable NTFS long paths and be in Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS.

Enable Win32 long paths

Enable Win32 long paths enabled

(Thanks magicandre1981 for the screenshots)

Please note that your application will need to have been designed to be long paths aware, so while enabling the group policy is a needed step, it does not guarantee that your application will be able to use long paths.

Older than Windows 10 1607 / Windows Server 2016

If your Windows version is older, you are out of luck.

While some tricks exist, they are not actionable by end users, so if your application does not work with long paths then there is nothing you can do except upgrading Windows or keeping paths short.

Nicolas Raoul
  • 10,711
  • 18
  • 64
  • 102
  • There is no such element in the Local Group Policy Editor in Windows 10 1809. – riQQ Aug 11 '20 at 10:48
  • @riQQ Can you specify which Edition of Windows you have? Because this policy exists in Windows 10 Pro or Enterprise in the *Filesystem* node, not the *NTFS* one. If you are using Home, you wouldn't even have access to `gpedit.msc`, so are you sure you are looking in the correct location? – KymikoLoco Sep 23 '20 at 18:56
  • @KymikoLoco Windows 10 Enterprise in a domain. I checked both `Filesystem` and `NTFS`: nothing there. My guess is that it can be controlled, what policies are shown here. – riQQ Sep 23 '20 at 19:01