cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lsj1888
Level 2

regdbgetkeyvalueex reads garbage string.

hi !!!
I have the following code to read path string from the registry.
-------------------------------------
szKey = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBGetKeyValueEx (szKey, "Path" , nvType, svNumValue, nvSize);
//SprintfBox(MB_YESNO,"TITLE","size : %d, data : %s",nvSize, svNumValue);
nResult = RegDBSetKeyValueEx(szKey, "Path", REGDB_STRING_EXPAND, TARGETDIR^"\\bin\\;" + svNumValue , -1);
--------------------------------------

in Window7 (64 bit),
the svNumValue (after RegDBGetKeyvalueEx) has some garbage string at the end of path string.(like this --> "C:\Program files (x86)\PHP\.........;C:\phython26^!@#$")

This is not occurred in other OS.

I checked the key value manually in the registry.(There is no garbage string)
The garbage string is different every time.

how can I solve this???

Thanks...
Labels (1)
0 Kudos
(1) Reply
MrTree
Level 6

Hi,

I tried your code on my Win7 x64 and it woked. Do you use svNumValue for the first time in this script?
0 Kudos