Page 1 of 1

[SOLVED] Registry key modification problem

Published: July 26, 2021 - 10:14 AM
by MorganeDeveho
Good morning,

I have a problem concerning a registry key modification package.
Here is the code:

Code: Select all

def install():
    registry_setstring(HKEY_CURRENT_USER, "Software\\SAP BusinessObjects\\Suite XI 4.0\\Crystal Reports\\FetchOptions",'NTablesMax','7530', type=REG_DWORD)
    pass
wapt cannot read the type and gives me an error: FATAL ERROR: ValueError: Could not convert the data to the specified type.

Re: Registry key modification problem

Published: July 26, 2021 - 11:16 AM
by elelay
Hello Morgane,

Python doesn't like spaces very much. For escapes, you need to put an 'r' before the string. In your case, it would look like this:

Code: Select all

def install():
    registry_setstring(HKEY_CURRENT_USER, r"Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\FetchOptions",'NTablesMax','7530', type=REG_DWORD)
    pass
PS: (From memory), wapt already adds the two backslashes

Is this better?

Étienne

Re: Registry key modification problem

Published: July 26, 2021 - 11:26 AM
by MorganeDeveho
Unfortunately, no.
It still displays the same error: FATAL ERROR: ValueError: Could not convert the data to the specified type

Re: Registry key modification problem

Published: July 26, 2021 - 11:42 AM
by elelay
Looking at the Python method, when using a DWORD key, you must use an integer , not a string, as an argument.
So, 7530 without the single quotes.

Re: Registry key modification problem

Published: July 26, 2021 - 11:54 AM
by MorganeDeveho
Thank you, the order is no longer showing an error, but there is a new problem.
The data should be 0x00007530 (30000)
2021-07-26_11h50_50.jpg
2021-07-26_11h50_50.jpg (4.81 KB) Viewed 4954 times
and with the command it becomes 0x00001d6a (7530)
2021-07-26_11h51_20.jpg
2021-07-26_11h51_20.jpg (4.55 KB) Viewed 4954 times

Re: Registry key modification problem

Published: July 26, 2021 - 11:59 AM
by elelay
Ah, okay.
So you wanted to change the value to '0x00007530' at first, I didn't understand.
In that case, you just need to replace 7530 with 30000, I think.

Re: Registry key modification problem

Published: July 26, 2021 - 4:25 PM
by MorganeDeveho
Thank you very much.
It works