Seite 1 von 1

REG_DWORD entries in hex or decimal?

Verfasst: 30 Nov 2013, 00:35
von SisterOfMercy
Just gotten an error on installation of a package:
Syntax Error in Section: Registry_install_AllProfiles (Command in line 1228): set "ScreenBufferSize" = REG_DWORD:0bb80091 -> 0bb80091 is no valid number

This works:

Code: Alles auswählen

openkey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Content]
set "CacheLimit"= REG_DWORD:00131072
This does not:

Code: Alles auswählen

openkey [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe]
set "ScreenBufferSize" = REG_DWORD:0bb80091
Do we have to convert these hex values to decimal? This would end up as 196608145, which is longer than the 8 bytes of REG_DWORD... :?:

Yeah I know, I should test it first before asking questions.. Blame the beer :twisted: :evil: :twisted:

Re: REG_DWORD entries in hex or decimal?

Verfasst: 30 Nov 2013, 01:41
von SisterOfMercy
By the way, the [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe] key gets expanded to [HKEY_CURRENT_USER\Console\C:\WINDOWS_system32_cmd.exe], which is not supposed to happen, as this is a real registry key. The workaround is of course to use a separate .reg file and import this, but still.

Re: REG_DWORD entries in hex or decimal?

Verfasst: 02 Dez 2013, 10:36
von n.wenselowski
Hello SisterOfMercy,

did you try using REG_DWORD is used to save integer values. For hex data you can use REG_BINARY.
Did you try that?


Kind regards

N. Wenselowski

Re: REG_DWORD entries in hex or decimal?

Verfasst: 02 Dez 2013, 14:45
von SisterOfMercy
Well, in the registry the value is a DWORD, so I used REG_DWORD for that. Have to look into it. :D

Re: REG_DWORD entries in hex or decimal?

Verfasst: 02 Dez 2013, 21:30
von SisterOfMercy
SisterOfMercy hat geschrieben:By the way, the [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe] key gets expanded to [HKEY_CURRENT_USER\Console\C:\WINDOWS_system32_cmd.exe], which is not supposed to happen, as this is a real registry key. The workaround is of course to use a separate .reg file and import this, but still.
'Fixed' this the following way:

Code: Alles auswählen

DefVar $escSystemroot$
Set $escSystemroot$ = "%" + "Systemroot" + "%"

[registry_install_allusers]
[HKEY_CURRENT_USER\Console\$escSystemroot$_system32_cmd.exe]
set $escSystemroot$ = EscapeString:%Systemroot%
did not work, this also got converted to c:\windows

Re: REG_DWORD entries in hex or decimal?

Verfasst: 02 Dez 2013, 21:32
von SisterOfMercy
SisterOfMercy hat geschrieben:JDo we have to convert these hex values to decimal? This would end up as 196608145, which is longer than the 8 bytes of REG_DWORD... :?:
'Fixed' this as well, it does not matter if it is longer than 8 bytes, it gets converted back as it should. So with an export of a .reg file from regedit you would have to convert the values of the dwords to decimal.

Re: REG_DWORD entries in hex or decimal?

Verfasst: 27 Mär 2014, 23:41
von SisterOfMercy
I recently read something in the manual...

Would this work?

Code: Alles auswählen

set "ScreenBufferSize" = REG_DWORD:0x0bb80091

previously:
set "ScreenBufferSize" = REG_DWORD:0bb80091