Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the valid characters for Registry keys and valuenames?

More specifically, what is the authoritative source for that information?

This may look like a non-programming question, but I need to know whether a registry path fed to my code contains a regular expression or not. I decided the best way to do that is assume that any occurrence of an invalid character (like '*') means a wildcard search.

like image 375
JCCyC Avatar asked Jun 18 '09 15:06

JCCyC


People also ask

What are the 5 registry keys?

What are the five registry keys? In most versions of Windows, the following keys are in the registry: HKEY_CLASSES_ROOT (HKCR), HKEY_CURRENT_USER (HKCU), HKEY_LOCAL_MACHINE (HKLM), HKEY_USERS (HKU), and HKEY_CURRENT_CONFIG.

What is key and subkey in registry?

The registry is a hierarchical database that contains data that is critical for the operation of Windows and the applications and services that run on Windows. The data is structured in a tree format. Each node in the tree is called a key. Each key can contain both subkeys and data entries called values.

What are the three types of values for a Windows Registry key?

The values contain the actual information stored in the Registry. There are three types of values; String, Binary, and DWORD - the use of these depends upon the context. There are six main branches, each containing a specific portion of the information stored in the Registry.

What is registry key and value?

Registry keys are container objects similar to folders. Registry values are non-container objects similar to files. Keys may contain values and subkeys. Keys are referenced with a syntax similar to Windows' path names, using backslashes to indicate levels of hierarchy.


2 Answers

For allowable key and value names, see the MSDN page on Structure of the Registry. In particular:

Each key has a name consisting of one or more printable characters. Key names are not case sensitive. Key names cannot include the backslash character (\), but any other printable character can be used. Value names and data can include the backslash character.

Registry value types are explained in detail on MSDN here, in case you need to know the allowable values.

like image 91
Reed Copsey Avatar answered Sep 26 '22 14:09

Reed Copsey


For all things Windows, MSDN has to be the authoritative source -- the article on Registry Element Size Limits implies Unicode is good and Structure of the Registry says that backslash and non-printable characters are disallowed in key names. Values merely have to be entirely printable characters.

like image 37
Rowland Shaw Avatar answered Sep 25 '22 14:09

Rowland Shaw