1

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
  • 11,561

1 Answers1

3

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
  • 11,561