Enable NTFS long paths in Windows Server 2016 by Group Policy

Windows Server 2016 was finally released last week, meaning we can finally lift the idiotic 260 characters limitation for NTFS paths. In this post I’ll show you how to configure the Enable Win32 long paths setting for the NTFS file system, through Group Policy (a GPO).

Microsoft writes about the Maximum Path Length Limitation on MSDN, and they write:

Maximum Path Length Limitation
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is “D:\some 256-character path string<NUL>” where “<NUL>” represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)

In the past, this 260 characters limitation caused errors and discomfort. Especially in the web hosting branche where you sometimes have to be able to save long file names. This resulted in (too) long paths and thus errors.

For example, have a look at this WordPress #36776 Theme update error Trac ticket. Which was a duplicate of #33053 download_url() includes query string in temporary filenames.

Fortunately, this limitation can now be unset and removed. Per default the limitation still exists though, so we need to set up a Local Group Policy. Or a Group Policy (GPO) in my case, since my server is in an Active Directory domain network.

You’ll learn how to set up a GPO to enable NTFS long paths in Windows Server 2016 in this article.

Note: Enabling “Long Paths” doesn’t magically remove the 260 character limit, it enables longer paths in certain situations. Adam Fowler has a bit more information about this is. Or are you wondering how to increase the configured maxUrlLength value in Windows Server & IIS? This’ll fix an IIS error The length of the URL for this request exceeds the configured maxUrlLength value.

But first things first.

This may interest you:   DisableNSRecordsAutoCreation with Dnscmd

You need to be able to set up this GPO using administrative templates (.admx) for Windows Server 2016. Because, in my situation, my Active Directory server is Windows Server 2012 R2 and doesn’t provide GPO settings for 2016.

Download Administrative Templates (.admx) for Windows 10 and Windows Server 2016 #

If you are, as me, on Windows Server 2012 R2, you need administrative templates (.admx files) for Windows Server 2016 to configure 2016 specific Group Policy Objects.

These few steps help you setting them up in your environment.

Download and install administrative templates for Windows Server 2016 in your Windows Server 2012 R2 Active Directory #

Folow these steps:

  1. Download Windows 10 and Windows Server 2016 specific administrative templates – or .admx files.
  2. Install the downloaded .msi file Windows 10 and Windows Server 2016 ADMX.msi on a supported system: Windows 10 , Windows 7, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2. You also need user rights to run the Group Policy Management Editor (gpme.msc), or the Group Policy Object Editor (gpedit.msc). But that’s for later use.
  3. The administrative templates are installed in C:\Program Files (x86)\Microsoft Group Policy\Windows 10 and Windows Server 2016, or whatever directory you provided during the installation. Copy over the entire folder PolicyDefinitions to your Primary Domain Controller’s SYSVOL\domain\Policies directory.
  4. Verify you’ve copied the folder, and not just the files. The full path is: SYSVOL\domain\Policies\PolicyDefinitions. This is explained in Microsoft’s Technet article Managing Group Policy ADMX Files Step-by-Step Guide.
This may interest you:   Windows Server 2016 on Hyper-V stuck at stopping

That’s it, you now have Group Policy Objects available for Windows Server 2016. Let’s enable Win32 long paths support now.

Configure Enable Win32 long paths Group Policy #

Now that you have your Windows Server 2016 Group Policy Objects available, it’s time to setup a GPO to enable NTFS long path support. Create the GPO in your preferred location, but be sure to target it on Windows Server 2016 only.

Please note that the GPO is called Enable Win32 long paths, not NTFS.

Enabling Win32 long paths will allow manifested win32 applications and Windows Store applications to access paths beyond the normal 260 character limit per node on file systems that support it. Enabling this setting will cause the long paths to be accessible within the process.

Start your Group Policy Management console and click through to the location where you want to add the GPO. Create a new GPO: Create a GPO in this domain, and Link it here..., and provide your GPO with a relevant name.

In the Settings tab, right click and choose Edit…. Now under Computer Configuration in the Group Policy Management Editor, click through to Policies > Administrative Templates > System > Filesystem. Configure and enable the Setting Enable Win32 long paths.

This screen configures the GPO "Enable Win32 long paths"

Configures “Enable Win32 long paths” GPO

this screen is a settings overview for the created GPO "Enable Win32 long paths"

GPO Enable Win32 long paths Settings overview

This is all you have to do to create the Group Policy for long Win32 paths. All that is left is to run gpupdate in an elevated cmd.exe command prompt.


Show your support


If you want to step in to help me cover the costs for running this website, that would be awesome. Just use this link to donate a cup of coffee ($5 USD for example). And please share the love and help others make use of this website. Thank you very much!


About the Author Jan Reilink

My name is Jan. I am not a hacker, coder, developer, programmer or guru. I am merely a system administrator, doing my daily thing at Vevida in the Netherlands. With over 15 years of experience, my specialties include Windows Server, IIS, Linux (CentOS, Debian), security, PHP, websites & optimization.

follow me on:

Leave a Reply

7 Comments on "Enable NTFS long paths in Windows Server 2016 by Group Policy"

avatar
  Subscribe  
newest oldest most voted
Notify of
Anders
Guest

I have done this, buts its not working.
Tryed on windows server 2016, local gpo and domaine gpo. Same result.
I have go all rettings in regedit and all settings is enabled.
However its still says error long paths

Susan E Bercaw
Guest

What do you mean by, “be sure to target it on Windows Server 2016 only”. I thought that you were saying that this would work on a Windows Server 2012 domain controller.

Susan E Bercaw
Guest

What do you mean by, “be sure to target it on Windows Server 2016 only.” Does this not work on Windows Server 2012?

Viktor
Guest

Where I can change this parameter for Windows 2012R2?