Does registry path have MAX_PATH limitation like file or folder path. What is the maximum length of registry path in Windows?
Thanks.
Does registry path have MAX_PATH limitation like file or folder path. What is the maximum length of registry path in Windows?
Thanks.
According to the MSDN:
255 characters. The key name includes the absolute path of the key in the registry, always starting at a base key, for example, HKEY_LOCAL_MACHINE.
If you want to modify the maximum path length limit, you can refer to: Maximum Path Length Limitation
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.
To enable the new long path behavior, both of the following conditions must be met:
The registry key
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD)must exist and be set to 1. The key's value will be cached by the system (per process) after the first call to an affected Win32 file or directory function (see below for the list of functions). The registry key will not be reloaded during the lifetime of the process. In order for all apps on the system to recognize the value of the key, a reboot might be required because some processes may have started before the key was set.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
The page you refer to me is about breaking limitation for path of filesystem. Is there any way to break limitation for path of key in registry.
Thanks.
No, you can not. The document says: Long values (more than 2,048 bytes) should be stored in a file, and the location of the file should be stored in the registry. This helps the registry perform efficiently. Maybe you can explain why you need to exceed this limit?
I only want to know the possibility of using a long path for key path exceeds 255 characters length in registry.
In the regedit.exe, is it possible to create a long key path exceeding 255 characters length?
Thanks.
Thanks. A little bit puzzled in your page. Is 255 characters the limitation of absolute path of a key, or the limitation of name of a key without path?
"The key name includes the absolute path of the key in the registry, always starting at a base key, for example, HKEY_LOCAL_MACHINE."
Sorry but just this sentence confusing me. Can I understand it in this way: 255 characters is maximum length of full path of a key in Windows registry?
Thanks.
7 people are following this question.