There are three basic data
types used in the Windows registry:
All data types ending with SZ are
STRING values. Think of SZ as standing for StringZ. A string consists of plain readable text. String values
are the most common values used in the Registry. All string values
are indicated by an AB icon,
makes sense since the data type is readable text.
Note that in Windows 95/98/ME,
Reg _SZ values are indicated by the "AB" icon only. There
is no column titled "Type" indicating the data type as
there is in Windows NT/2000/XP. In other words, in Windows 95/98/ME,
you do not see the words Reg _SZ, but
in Windows NT/2000/XP you do.
Also in Windows 9x, a string
value is always enclosed in quotations (but they are added automatically
to the string value. You do not need to add them yourself when entering
Here are screenshots of a Windows 98se and Windows XP string dialog box.
Notice in the 98 image (the first one) there is only a Name and Data column
and that in the Edit String box, the value data, Bitmap Image, is entered
without quotations, but under the columm Data, quotations appear.
In Windows XP, notice the Type column
and that no quotations are added around “Bitmap Image”
There are 3 types of STRING (SZ) data used
in the registry, but only NT based kernel systems like Windows NT, 2000
and XP use all 3. In Windows 95/98/Me, only
one string data type is used.
The three types of string data that can be used are:
This is the main
type of string data used in the registry and the only type of string data used in Windows 95/98/ME. "YES" or "NO" are
common Reg_SZ values, as are command line strings such as "C:\Program
Files\Outlook Express" or even phrases or complete sentences. A
string can also consist of numbers. Colors,
for example, are usually stated numerically in the registry.
See this key for examples of numeric string values:
This is an "expandable" string
value holding a variable.
Example: %SystemRoot% and %UserName% are variables that are
used to indicate the System folder and the name of the logged in user.
Windows will replace (or EXPAND) the variable with the full path when
the command is called.
For example, %SystemRoot%
is a variable that can be used to find the Windows System folder
and can be entered instead of
C:\Windows\System32. You might be thinking, what's the advantage of
It's a big advantage. With
a variable, you do not need to know the drive letter the
user has Windows installed on. Say you need to send
a reg file, that has a command that will call a file in the "Windows\System32\Drivers" folder, to
two users. One user has Windows installed
on C, and the other on E. Without using a variable, you would
need to make two separate files.
One including the line "C:\Windows\System32\Drivers" and
another with "E:\Windows\System32\Drivers." With the variable
only do you just need to make one file with the command "%SystemRoot%\Drivers" but
you do not even need to know in advance what drive your users have
Windows installed on.
Another common and useful
variable is %USERPROFILE% which returns the user folder.
For example, the path of your Desktop folder may be C:\Documents
and Settings\JOHN\Desktop. With a variable, you would just
have to enter %USERPROFILE%\Desktop This will find the desktop
of the current logged-on user no matter what drive Windows
is installed on.
REG_EXPAND_SZ data is only
properly displayed when using the regedt32 editor that's included in
NOTE: Even though Windows 9x does
not use this data type, it does not mean that variables cannot
be used in the Windows 9x registry. Variables can be used with
REG_SZ as well, but not as extensively. However, variables
should not be entered as REG_SZ in Windows NT/2000/XP.
Always use REG_EXPAND SZ
for variables to ensure they function and are displayed correctly.
type is also
for Windows NT/2000/XP systems only and is a multiple string
made up of characters and numbers - used for
entering more than one value, each one separated by a NULL character.
Example, this multi string value consists of 4 entries:
Like all string values
it is human readable text. Note that you can
edit these values, but not create them. This is a more advanced
string type and also accessed and worked with using regedit32.
So far we described STRING
values only (SZ values with an AB icon) Now, let's explain
the other two main data types - BINARY and DWORD
Binary consists of binary data
displayed in hexadecimal format. Binary is used most commonly with hardware
and configuration settings. In Windows 9x, a binary value type is indicated
by an icon with the blue letters 011 over the letters 110:
Like the string AB icon, this makes sense too as binary data consists
of only two digits, 0 and 1. The reason the data is
usually displayed in hex format is that binary data can be very lengthy
and inconvenient. Two hexadecimal digits
neatly represent 8 bits.
Note that in the right
hand side of the hex values are their ASCII equivalents, i.e.,
hex value 50 = P
Dword data types also
consist of binary data, but two points distinguish them from binary types.
1. The binary data that
can be entered is limited to 32 bits (4 bytes) in length.
2. The binary data can be entered in hexadecimal or decimal format.
The same blue icon used for Binary is used for Dword values
(this is because both values are essentially the same
aside from the amount of data each can hold):
- DWORD stands for Double
here is why: 8 bits = 1 byte =1 character
- It takes 2 characters to form the minimum word
(such as "be" "to" or "it") Therefore
it takes 16 bits or 2 bytes to form ONE word.
- A DWORD value can hold a maximum of 32 bits which
is equal to
two words or a DWORD - a DOUBLE WORD
In hexadecimal format, 2 words consist
of 8 digits, i.e., B2
01 23 F9 and thus the registry displays
DWORD values as 8 digits with the
decimal equivalent displayed in brackets.
For example when you enter a hex data value of 1, the resulting display
will be 0x00000001(1).
DWORD values are commonly used for boolean type entries such as 0 for
false or disabled, and 1 for true or enabled.
System policy settings, device drivers, and services use DWORD values
Note that the value data
can be entered in either hexadecimal or decimal format. This
is mainly for convenience. Also notice that the decimal
equivalent is shown in brackets.
There is also another data
type in the registry named QWORD though it is not at all common.
This is similar to DWORD except it can hold 64 bits (double the size
of a DWORD value).
If you find bits
and bytes confusing, see my article "Just A Little
Bit" which explains bits and bytes with the newbie in mind. http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=247.
Though not as widely used
as the other data types, there also exists in the NT line
of Windows systems (NT/2000/XP), "RESOURCE" data
types with names like REG_RESOURCE_LIST, REG_FULL_RESOURCE_DESCRIPTOR,
and a few others with Resource in the name.
These are all specialized
data types used mostly for hardware settings. Here, I'll just briefly
describe the two more common Resource types.
"A series of nested arrays designed to store a resource list used by a physical
hardware device. This data is detected and written into the HardwareDescription
tree by the system and is displayed in Registry Editor in hexadecimal
format as a Binary Value."
A Full Resource Descriptor
allows you to view and edit actual hardware settings. When you double click
a value with the Resource Descriptor type, a dialog box opens up.
Example: if you go to HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System you
should see a REG_FULL_RESOURCE_DESCRIPTOR value named Configuration Data..Double clicking
Configuration Data will bring up a dialog box such as this:
"A series of
nested arrays designed to store a resource list used by a hardware
device driver or one of the physical devices it controls. This data is detected
and written into the ResourceMap tree by the system and is displayed in Registry
Editor in hexadecimal format as a Binary Value."
A Resource List is used
when a hardware device has more than one full resource descriptor.
This is common with network cards and memory devices.
When you double click a value in this data type, a Resource List box
comes up where you select the specific resource and then click
Display to bring up the dialog box allowing you to see the full descriptor
Here is an example of this
type of value:
Abstraction Layer\ACPI Compatible Eisa/Isa HAL
All the Resource data
types are for advanced hardware related configurations and
shouldn't be messed with unless you know what you are doing.
And again, these types are not used in Windows 95/98/ME.
There are two registry editors
in Windows - regedit.exe which is the most commonly used one and ships
with ALL Windows versions.
Then there is regedt32 which can work with the additional string value
types mentioned previously, and which ships with NT/2000/XP.
Never attempt to edit data types that is only meant for regedt32.exe
In other words, the REG_MULTI_SZ and REG_EXPAND_SZ
string data types are not recognized properly by regedit.exe
and may be displayed differently (i.e., as binary data) and attempting
to edit those values with regedit may result in erroneous settings
which can cause system problems.
Value Name Size Limit
is a limit to how long a Value Name can be. In Windows 95/98/ME,
a value name cannot exceed 255 characters but in Windows XP it can be up
to 16,383 characters long. For Windows 2000 it is a little different than XP. In
2000, a maximum of 260 Ansi or 16,383 Unicode characters may be used
in naming a value.
Data Size Limits
In Windows 95/98/ME, the
maximum amount of data that can be entered for any value is 16,300
With Windows NT/2000/XP, there is no limit as long as your memory can
However, registry data more than 2000 bytes long can be slow to read
or load. Microsoft recommends that data over 2048 bytes should be stored
in a file on the hard drive and just called from the registry when needed.
Finally, no key can contain
data greater than 64,000 bytes. This applies to all Windows versions. To
give you a more realistic view of how much data all these byte limits represent,
consider that the entire text length of this article is around 10,000 bytes
For more registry tips
and answers, subscribe to my free Registry Answers newsletter:
Interested in learning
the registry from the ground up in plain English?
Check out Registry for Newbie’s - nothing beats it for the newbie: