Long paths not working in windows 2019

Bhaskar Venkatesha 1 Reputation point

Followed the steps given below to enable long paths and rebooted the machine

Press Win + R keys on your keyboard and type regedit then press Enter. Registry Editor will be opened.

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.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.
6.Restart machine.

Executed the below program to check if the file gets created in the already existing folder structure C:\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz

int main()
HANDLE h = CreateFileA(

if (h == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); printf("err %dn", err); getchar(); return 1; }

return 0;

The above program failed to create the file and produced the following output
err 3

The same program worked in windows 2016

What additional thing needs to be done in windows 2019 for long paths to work?

Machine details
Windows server 2019
Microsoft windows Server
Version 1809 (OS build 17763.316)

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,598 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,591 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sreeju Nair 12,181 Reputation points

    Based on your question, it seems the group policy update is not reflected yet. Did you try gpupdate after updating the value? You may also try gpupdate /force to ensure the policy settings are reapplied.

  2. Limitless Technology 44,101 Reputation points

    Hello @Bhaskar Venkatesha

    You can try using the PowerShell command from a terminal window with elevated privileges and see if that helps you.

    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
    -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

    Some users have also found that extract target path was using '/' instead of '\' in server 2019 and changing this back has sorted the issue for them.

    Here is a thread as well that discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.

    Windows Server Long Path Name Support (2016 vs 2019)
    Hope this resolves your Query!!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments