Registry Element Size Limits

The following table identifies the size limits for the various registry elements.

Registry ElementSize Limit
Key name255 characters
Value name16,383 characters
Windows 2000:  260 ANSI characters or 16,383 Unicode characters.
ValueAvailable memory (latest format)

1 MB (standard format)

TreeA registry tree can be 512 levels deep. You can create up to 32 levels at a time through a single registry API call.

 

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.

The file location can be the name of a value or the data of a value. Each backslash in the location string must be preceded by another backslash as an escape character. For example, specify "C:\\mydir\\myfile" to store the string "C:\mydir\myfile". A file location can also be the name of a key if it is within the 255-character limit for key names and does not contain backslashes, which are not allowed in key names.

Send comments about this topic to Microsoft

Build date: 11/19/2009

Tags :


Community Content

Carol Buchmiller - MSFT
Regedit does not display value names longer than 255 characters
Regedit.exe does not display value names longer than 255 characters, so if you use Regedit to confirm creation of a value it may appear that creation has failed. Check the return value of RegSetValueEx for ERROR_SUCCESS to confirm successful creation of a value, and use the reg.exe command-line tool to view value names of any length. http://technet.microsoft.com/en-us/library/cc732643(WS.10).aspx

Page view tracker