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, by a Group Policy Object (a GPO), and «LongPathsEnabled» in the Windows registry. This is still required for Windows Server 2022 and Windows Server 2019.
Maximum Path Length Limitation (MAX_PATH) in Windows Server
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.)
Microsoft Developer Network: Naming Files, Paths, and Namespaces
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.
In this post you’ll learn how to set up a GPO to enable NTFS long paths in Windows Server 2016 and Windows Server 2022/2019 using the LongPathsEnabled registry value.
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.
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 (at the time of this writing), you need administrative templates (.admx
files) for Windows Server 2016 to configure 2016 specific Group Policy Objects. The same goes for Windows Server 2022 and 2019.
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:
- Download Windows 10 and Windows Server 2016 specific administrative templates — or
.admx
files. - 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. - 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’sSYSVOL\domain\Policies
directory. - 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.
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
Learn how to set up WMI filters for 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»‘
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.
Verify LongPathsEnabled registry value
If needed, you can use the following cmd.exe or PowerShell commands to verify the LongPathsEnabled registry value is set correctly:
C:\>reg query HKLM\System\CurrentControlSet\Control\FileSystem /v LongPathsEnabled
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem
LongPathsEnabled REG_DWORD 0x1
PS C:\> (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
1
Don’t forget about your Windows Server 2022 and Windows Server 2019 servers, they still require this LongPathsEnabled registy value.
Use PowerShell to configure «Enable Win32 long paths»
If your servers are not in an Active Directory network and you want to enable the «Win32 long paths» (or LongPathsEnabled registry value) you can use PowerShell for the job. Here is a small PowerShell script that adds the registry value if the script is run on an supported Windows Server version.
#
# Add LongPathsEnabled registry value using PowerShell
#
function Test-RegistryValue {
param (
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$Path,
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$Value,
[switch]$ShowValue
)
try {
$Values = Get-ItemProperty -Path $Path | select-object -ExpandProperty $Value -ErrorAction Stop
if ($ShowValue) {
$Values
}
else {
$true
}
}
catch {
$false
}
}
# Windows Server 2016 build is 10.0.14393
[version]"10.0.14393"
[version] $winver = $(Get-CimInstance -Namespace root\cimv2 -Query "SELECT Version FROM Win32_OperatingSystem").Version
if($winver -ge [version]"10.0.14393") {
if ($(Test-RegistryValue "HKLM:System\CurrentControlSet\Control\FileSystem" LongPathsEnabled) -eq $false) {
New-ItemProperty -Path "HKLM:System\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled -PropertyType DWORD -Value 1 -Force
}
}
This script contains a function that tries to look up if the requested registry path / value already exists. If it returns false, New-ItemProperty
is executed to add LongPathsEnabled with value 1 to the Windows. A reboot afterwards is required.
Enable Win32 long paths in Windows 11 and Windows 10 (Bonus!)
If your client computer running Windows 11 or Windows 10 is not in an Active Directory and/or does not have the above mentioned GPO active, you can enable it yourself in a local security policy (LSP). You do need administrator privileges to follow the next steps:
- As an administrator, start
gpedit.msc
for example in an elevated PowerShell terminal venster or through Start (Select the as administrator option). Press enter and Group Policy Editor opens. - Go to Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem, then enable the Enable Win32 long paths option.
- Restart your computer.
Of course you can add the registry value manually as well. Want to silently import .reg file in your Windows registry?
Did you like Enable NTFS long paths GPO in Windows Server 2022, 2019 and Windows Server 2016?
Then please, take a second to support Sysadmins of the North and donate!
Paypal
Your generosity helps pay for the ongoing costs associated with running this website like coffee, hosting services, library mirrors, domain renewals, time for article research, and coffee, just to name a few.
Наткнулся на слишком длинную каталогизацию, которые превышает 250+ символов, надо ещё больше делать но ограничение не дают….
На WinSRV Домене поменял GPO вот тут: Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS
Включил длинные пути Обновил политику, всё равно не даёт.
Тоже самое сделал на сервере файловом, обновил политику не даёт…
На пк тоже самое сделал, не помогает.
Как правильно отключит ограничение это?
Вот какой максимальный путь смог создать, но он уже не редактируется, увеличить даже на 1 символ не могу.
«A:\IT\TestTestTestTestTestTestTestTestTest\TestTestTestTestTestTestTestTestTestTestTestTestTestTest\TestTestTestTestTestTestTestTestTestTestTestTestTest\TestTestTestTestTestTestTestTestTestTestTestTestTestTestTest\ZITTestTestTestTestTestTestTestTe\Документ Microsoft Word.docx»
-
Вопрос задан
-
705 просмотров
Пригласить эксперта
Ээто ограниение winapi. Так просто вот прям для всех оно не снимается. Только те программы которые сами знают как его обходить или новые, написанные для 10 винды в которой работают соответствующие спец-настройки прописанныемв манифесте программы и реестре. Короче, лучше поменять подход
1. Версии ОС на файловом сервере и клиенте, с которого обращаетесь к shared folder?
Если Windows 10 и Server 2016\Server 2019 — и если этот ключ есть в gpedit.msc и там и там — то все должно работать.
https://docs.microsoft.com/en-us/windows/win32/fil…
2. Что значит «WinSRV Домене поменял GPO вот тут: Local Computer Policy«? Можете объяснить — что вы хотели достичь?
Пробуйте так
\\server\IT\TestTestTestTestTestTestTestTestTest\TestTestTestTestTestTestTestTestTestTestTestTestTestTest\TestTestTestTestTestTestTestTestTestTestTestTestTest\TestTestTestTestTestTestTestTestTestTestTestTestTestTestTest\ZITTestTestTestTestTestTestTestTe\Документ Microsoft Word.docx
Знаю что проблема длинных путей точно решается сменой системы на ReFS, там это ограничение снято.
255 символов — это стандарт. да, новые виндусы позволяют его обойти. но надо понимать что Вы делаете непереносимую ни с чем не совместимую систему. грамотное решение — исправить голову автора, а не обойти стандарт.
Войдите, чтобы написать ответ
-
Показать ещё
Загружается…
Минуточку внимания
Long paths not working in windows 2019
- Press Win + R keys on your keyboard and type regedit then press Enter. …
- Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
- Edit LongPathsEnabled and set it to 1.
- Press Win + R keys on your keyboard and type gpedit.
- How do I extend Windows * Server 2016 file path support from 260 to to 1024 characters?
- What is the maximum length of path in Windows?
- What does it mean when the file path is too long?
- How do I enable long path support in Windows Server 2019?
- Does Windows Explorer support long paths?
- Can’t find enable NTFS long paths?
- Why is there a 256 character limit?
- Should I disable the path length limit?
- What is the maximum length of a file path?
- How do I determine file path length?
- What is the maximum number of characters allowed in a filename path?
- How do you fix Cannot open the file because the file path is more than 259 characters?
How do I extend Windows * Server 2016 file path support from 260 to to 1024 characters?
b) Navigate to the following directory: Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS. c) Click Enable NTFS long paths option and enable it. These changes have been verified with Intel® Quartus® Prime Pro and Windows* Server 2016 build 1607 only.
What is the maximum length of path in Windows?
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.
What does it mean when the file path is too long?
If you are facing the error Destination Path Too Long when trying to copy or move a file to a folder, try the quick trick below. The reason you receive the error is that File Explorer failed to copy/delete/rename any path-name longer than 256 characters.
How do I enable long path support in Windows Server 2019?
Press Win + R keys on your keyboard and type gpedit. msc then press Enter. Group Policy Editor will be opened. Go to Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem, then enable the Enable Win32 long paths option.
Does Windows Explorer support long paths?
However, the long paths are not supported under File Explorer with the latest Windows version. That is the reason why it is not working even tweaking the registry and Group Policy.
Can’t find enable NTFS long paths?
Go to Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem. 3. There, double click and enable the option Enable NTFS long paths.
Why is there a 256 character limit?
The limit occurs due to an optimization technique where smaller strings are stored with the first byte holding the length of the string. Since a byte can only hold 256 different values, the maximum string length would be 255 since the first byte was reserved for storing the length.
Should I disable the path length limit?
Disabling the path length is better than shortening the path or the file name. Because if someone installed the Python in a directory more than a recommended length means it will cause the error. So using this option is much better.
What is the maximum length of a file path?
While Windows’ standard file system (NTFS) supports paths up to 65,535 characters, Windows imposes a maximum path length of 255 characters (without drive letter), the value of the constant MAX_PATH. This limitation is a remnant of MS DOS and has been kept for reasons of compatibility.
How do I determine file path length?
To run the Path Length Checker using the GUI, run the PathLengthCheckerGUI.exe. Once the app is open, provide the Root Directory you want to search and press the large Get Path Lengths button. The PathLengthChecker.exe is the command-line alternative to the GUI and is included in the ZIP file.
What is the maximum number of characters allowed in a filename path?
Individual components of a filename (i.e. each subdirectory along the path, and the final filename) are limited to 255 characters, and the total path length is limited to approximately 32,000 characters. However, on Windows, you can’t exceed MAX_PATH value (259 characters for files, 248 for folders).
How do you fix Cannot open the file because the file path is more than 259 characters?
The answer is to rename the file, the folders or move the file to a shorter path. There is a registry key that allows you to have long file paths now.
-
-
#1
Здравствуйте. Появилась потребность увеличить длину пути папок и файлов в сети, так как не получается открыть файлы, которые по этим путям располагается. Возникает ошибка «Неверно задано имя папки». Пробовал менять в реестре
"reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1"
, не сработало. Пробовал через групповые политики Конфигурация компьютера > Административные шаблоны > Система > Файловая система > Включить длинные пути Win32 не помогло (после обоих манипуляций перезагружался). Файлы по длинным путям открываются с той же ошибкой. В чем может быть проблема? Еще интересно почему в редакторе политики значок пункта Включить длинные пути Win32 со стрелочкой вниз.
Последнее редактирование модератором:
-
-
#2
ОС пользователей Windows 10 Pro. Компьютеры в домене, ОС сервера Windows Server 2019 Standart. Режим работы домена Windows Server 2016, режим работы леса Windows Server 2012.
Ozzy
Случайный прохожий
-
-
#3
не тот ли это случай про ограничения в файловой системе NTFS 256 символов или что то такое, не помню точно.
Попробуйте через GPO включить параметр Enable NTFS long path
UPd не увидел картинку сразу)
-
-
#4
Стрелка вниз на параметре групповой политики означает что параметр является предпочтением
Ozzy
Случайный прохожий
-
-
#5
Файлы по длинным путям открываются с той же ошибкой.
А с какой той же ?
-
-
#6
Возникает ошибка «Неверно задано имя папки»
-
-
#7
ОС пользователей Windows 10 Pro
А какой билд? Может версия не та
4.3 Enabling Windows Long Path (Windows 10 — 1803 build)
-
-
#9
не тот ли это случай про ограничения в файловой системе NTFS 256 символов или что то такое, не помню точно.
Попробуйте через GPO включить параметр Enable NTFS long pathUPd не увидел картинку сразу)
это не этот же параметр ?
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
src
-
-
#10
это не этот же параметр ?
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
src
Ну раз называется по другому значит не тот
-
-
#11
Release Date:
5/27/2020
Может проапдейтить?
-
-
#12
и чем ему это поможет ? Это баг что ли ?
-
-
#13
и чем ему это поможет ? Это баг что ли ?
Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from common Win32 file and directory functions. However, you must opt-in to the new behavior.
-
-
#14
Release Date:
5/27/2020Может проапдейтить?
Установил все последние обновления.
Версия: 21H2. Сборка ОС 19044.1566.
Не помогло. PDF открываются. docx, xlsx нет. Переименовать не дает.
Windows 10: Windows Server Long Path Name Support 2016 vs 2019
Discus and support Windows Server Long Path Name Support 2016 vs 2019 in Windows 10 Network and Sharing to solve the problem; I have an issue with extracting a tar file with relatively long paths ~120+ chars into a folder structure that is also relatively long 130 chars, as…
Discussion in ‘Windows 10 Network and Sharing’ started by jfbradfo, Apr 19, 2021.
-
Windows Server Long Path Name Support 2016 vs 2019
[COLOR=rgba85, 85, 85, 1]I have an issue with extracting a tar file with relatively long paths ~120+ chars into a folder structure that is also relatively long 130 chars, as some of the file names are long enough they exceed the 260 character limit for path names. We have enabled the Enable Win32 long paths policy, as well as ensured that the LongPathsEnabled registry value is set to 1, and the servers were rebooted after the change. I’m using 7-Zip v19.00 to do the extracts and have used both TAR and ZIP files to ensure that the format doesn’t play a part.[/COLOR]
[COLOR=rgba85, 85, 85, 1]On a Windows Server 2016 instance, the extract works correctly with no errors. However, on a Windows Server 2019 instance, using the same TAR and ZIP files and the same target path to extract 130 chars, several files fail to extract, apparently because the paths are longer than 260 characters. We validated this by shortening the extract target path slightly, which allowed all files to extract without error.[/COLOR]
[COLOR=rgba85, 85, 85, 1]We are able to make this work with the 7-Zip GUI and with WinZip, but the command line fails consistently on Server 2019. [/COLOR]
The one server configuration difference we noticed was that the Server 2016 box has .NET 4.7 and the Server 2019 box has .NET 4.7.2.
[COLOR=rgba85, 85, 85, 1]What differences in long path handling have we missed in Server 2019 vs 2016?[/COLOR]
[COLOR=rgba85, 85, 85, 1]
Thanks in advance![/COLOR] -
Activate RDS CAL 2019 on Windows Server 2016
Dear Microsoft Support,
We recently purchased Windows Server RDS CAL 2019.
When we tried to install Windows Server RDS CAL 2019 into Windows Server 2016, it shows the license is not recognized and couldn’t install.
My questions are :
- Can’t Windows RDS CAL 2019 be installed in Windows Server 2016? If can, how?
- Is there any way to downgrade RDS CAL from 2019 to 2016 version?
Thanks,
-
Office 2019
Only supported on Win10. Sorry, 8.1 users, only 4 years old, gotta go.
Microsoft Office 2019 will only work on Windows 10
https://blogs.technet.microsoft.com…-to-office-and-windows-servicing-and-support/
Spoiler Office 2019
Last year at Ignite, we announced Office 2019 – the next perpetual version of Office that includes apps (including Word, Excel, PowerPoint, and Outlook, and Skype for Business) and servers (including Exchange, SharePoint, and Skype for Business). Today we’re pleased to share the following updates:- Office 2019 will ship in H2 of 2018. Previews of the new apps and servers will start shipping in the second quarter of 2018.
- Office 2019 apps will be supported on:
- Any supported Windows 10 SAC release
- Windows 10 Enterprise LTSC 2018
- The next LTSC release of Windows Server
- The Office 2019 client apps will be released with Click-to-Run installation technology only. We will not provide MSI as a deployment methodology for Office 2019 clients. We will continue to provide MSI for Office Server products.
-
Windows Server Long Path Name Support 2016 vs 2019
Exchange Support For Windows Server 2016
Exchange Support For Windows Server 2016
Source: https://blogs.technet.microsoft.com/…s-server-2016/
Windows Server Long Path Name Support 2016 vs 2019
-
Windows Server Long Path Name Support 2016 vs 2019 — Similar Threads — Server Long Path
-
Windows Server 2016 DataCenter to Windows Server 2019
in Windows 10 Gaming
Windows Server 2016 DataCenter to Windows Server 2019: I successfully upgrade Windows Server 2012r2 to Windows Server 2016 datacenter. I then attempted to upgrade Windows Server 2016 data Center to Windows Server 2019 data center. After I mount the 2019 ISO and accept . The 2019 Setup won’t allow me to Keep personal files and… -
Windows Server 2016 DataCenter to Windows Server 2019
in Windows 10 Software and Apps
Windows Server 2016 DataCenter to Windows Server 2019: I successfully upgrade Windows Server 2012r2 to Windows Server 2016 datacenter. I then attempted to upgrade Windows Server 2016 data Center to Windows Server 2019 data center. After I mount the 2019 ISO and accept . The 2019 Setup won’t allow me to Keep personal files and… -
Windows Server 2022 vs 2019 vs 2016 Feature differences
in Windows 10 News
Windows Server 2022 vs 2019 vs 2016 Feature differences: [ATTACH]Windows Server 2022 offers the latest features to Microsoft customers and is considered the most secure version as compared to its previous counterparts. Due to the increasing cyber security threats and attacks, Microsoft has introduced the new Windows Server 2022… -
Windows firewall Predefined Inbound Rules Server 2016 vs 2019
in Windows 10 Gaming
Windows firewall Predefined Inbound Rules Server 2016 vs 2019: On my systems there seems to be a larger set of predefined inbound rules in server 2016 vs 2019 for File and Print sharing. Also those extra rules seem to be enabled by default. Is this some extra hardening on server 2019?For some reason on my 2016 build I had the file and… -
Windows firewall Predefined Inbound Rules Server 2016 vs 2019
in Windows 10 Drivers and Hardware
Windows firewall Predefined Inbound Rules Server 2016 vs 2019: On my systems there seems to be a larger set of predefined inbound rules in server 2016 vs 2019 for File and Print sharing. Also those extra rules seem to be enabled by default. Is this some extra hardening on server 2019?For some reason on my 2016 build I had the file and… -
Windows firewall Predefined Inbound Rules Server 2016 vs 2019
in Windows 10 Software and Apps
Windows firewall Predefined Inbound Rules Server 2016 vs 2019: On my systems there seems to be a larger set of predefined inbound rules in server 2016 vs 2019 for File and Print sharing. Also those extra rules seem to be enabled by default. Is this some extra hardening on server 2019?For some reason on my 2016 build I had the file and… -
Windows firewall Predefined Inbound Rules Server 2016 vs 2019
in Windows 10 Gaming
Windows firewall Predefined Inbound Rules Server 2016 vs 2019: On my systems there seems to be a larger set of predefined inbound rules in server 2016 vs 2019 for File and Print sharing. Also those extra rules seem to be enabled by default. Is this some extra hardening on server 2019?For some reason on my 2016 build I had the file and… -
Windows firewall Predefined Inbound Rules Server 2016 vs 2019
in Windows 10 Software and Apps
Windows firewall Predefined Inbound Rules Server 2016 vs 2019: On my systems there seems to be a larger set of predefined inbound rules in server 2016 vs 2019 for File and Print sharing. Also those extra rules seem to be enabled by default. Is this some extra hardening on server 2019?For some reason on my 2016 build I had the file and… -
File History and Long Path Names
in Windows 10 Customization
File History and Long Path Names: Shawn — or anybody that knows…Can you tell me if FH manifest is Long Path aware?
(Sorry — All the FH .manifest files I can find are binary, not text)I am trying to help a dyslexic user with memory problems (memory as in «brain», not «bytes»)
Her system is Win 10 Home,…