How to allow long paths in Windows (longer than 260 characters)
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
.
(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
I am Nicolas Raoul, IT consultant in Tokyo. Feel free to copy/paste the source code from my StackExchange answers, I release it to the public domain.
Updated on September 18, 2022Comments
-
Nicolas Raoul over 1 year
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.
-
Ramhound almost 7 yearsThe question might be different but the answer still applies, and is in fact, nearly identical. Even uses the exact same screenshots.
-
Nicolas Raoul almost 7 yearsNot 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.
-
-
riQQ over 3 yearsThere is no such element in the Local Group Policy Editor in Windows 10 1809.
-
KymikoLoco over 3 years@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? -
riQQ over 3 years@KymikoLoco Windows 10 Enterprise in a domain. I checked both
Filesystem
andNTFS
: nothing there. My guess is that it can be controlled, what policies are shown here.