Link to home
Start Free TrialLog in
Avatar of holgrave
holgraveFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How much binary data can be stored in a registry key value?

How much binary data can be stored in a registry key value?

I have a Microsoft object (regobj.dll) that allows me to easily manipulate the registry.

I can use it to store binary data as a key value. But what is the limitation on the size of binary data for each key?
Avatar of mccainz2
mccainz2

The maximum size for any single Registry value entry is 1MB
ASKER CERTIFIED SOLUTION
Avatar of mccainz2
mccainz2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Whay do you want to do that?
What are you trying to do? There may be a better or differnt way to accomplish your task.
I would suggest not storing that much data in the registry. Instead store the data in a file and store the location of the file in the registry.
Avatar of holgrave

ASKER

Hey ventond - you almost quoted 'the book' word for word!  The link that mcainz2 gave states:

"Generally, data consisting of more than one or two kilobytes (K) should be stored as a file and referred to by using a key in the registry rather than being stored as a value." ;-)

Actually I expect my data to exceed no more than 1K - so I think it is OK.

From the links that mccainz2 gave we can say:

"NT-Server 4.0 the maximum Registry value entry is 1MB."

I have just had a look at the win95rk.hlp - the Win95 Help Guide that comes on the Win95 CD. And it states:

"A value entry has three parts: the data type of the value (which appears as an icon), the name of the value, and the value itself. A value entry cannot be larger than about 64K."

So for Win95 the maximum size of a value is 64K. And it would be SAFE to assume that this same size limit applies to Win98 and ME.

I don't know definately what the limitations are for:
W98
ME
W2K
XP

But if I stick to the limit of 64K then I will be OK. And anyway my data is not expected to exceed more than 1K.