Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DWORD registry value of "ffffffff"

Status
Not open for further replies.

JimHolland

Programmer
Feb 5, 2003
6
0
0
GB
I'm trying to add a DWORD registry entry with a hex value of "ffffffff".

WshShell.Regwrite"HKEY_CLASSES_ROOT\Path\Path\Path\Key", ffffffff, "REG_DWORD"

but it is not being populated. It's fine if I use zero - but it ignores it when I use the hex value. Can anyone help me out?
 
More specifically - I'm getting an overflow error 800A0006 as the DWORD value i'm trying to create is "4294967295".

Does anyone know how I would be able to get around this..?
 
Have you tried this ?
WshShell.Regwrite "HKEY_CLASSES_ROOT\Path\Path\Path\Key", -1, "REG_DWORD"
or this:
WshShell.Regwrite "HKEY_CLASSES_ROOT\Path\Path\Path\Key", CLng(&Hffffffff), "REG_DWORD"


Hope This Help
PH.
 
Hello JimHolland,

If it is a REG_DWORD value, you only need to input the correct hexadecimal format which is &HFFFFFFFF.
Code:
WshShell.Regwrite "HKEY_CLASSES_ROOT\Path\Path\Path\Key", &Hffffffff, "REG_DWORD"
No reason of it not working.

Besides, when I cut and paste your line, I see there is not a space separating .Regwrite and the "HKEY_...". Is it just a typo? (I hope so.)

regards - tsuji
 
I can't seem to find the relevant link, but there is an issue with 32-bit values in VBScript. VBScript treats the first bit as a sign bit, so in reality the values are only 31-bits long. To get around this, append an additional ampersand, "&", to the end of the word.

WshShell.Regwrite"HKEY_CLASSES_ROOT\Path\Path\Path\Key", &Hffffffff&, "REG_DWORD"

Zy
 
I asked the same question a week ago and PHV gave the best suggestion. use -1 as the value you are setting. When you look at it in the registry you will see that it will read as FFFFFFFF.
 
Hello all,

If it is _"REG_WORD", &HFFFFFFFF is no problem at all. If you actually want "REG_BINARY" that is another matter that I had dealt with it previously.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top