View Single Post
Old 6th December 2006, 15:44   #1
Junior Member
Join Date: Nov 2006
Posts: 19
Problem using WriteRegDWORD

I am trying to write an integer stored in a variable into a REG_DWORD and I am having some problems. The line I am using to store this integer is:
WriteRegDWORD HKLM "Software\Classes\ClassName" "class_key" $ClassKey

$ClassKey holds an 8 character decimal number entered by the user. If $ClassKey is “11111111” then it is stored into the registry OK. If $ClassKey is “01111111” (which is 0x1f447) then what is actually stored in the registry is 299593 (which is 0x49249)
If $ClassKey is “1111111”, (no leading 0) then it will be stored correctly. I have to allow for the user to enter leading zeros.
Can someone tell me what I am doing wrong and how I can get around it?

Install-O-Matic is offline   Reply With Quote