REG_DWORD entries in hex or decimal?

Antworten
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

REG_DWORD entries in hex or decimal?

Beitrag 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:
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: REG_DWORD entries in hex or decimal?

Beitrag 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.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: REG_DWORD entries in hex or decimal?

Beitrag 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

Code: Alles auswählen

import OPSI
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: REG_DWORD entries in hex or decimal?

Beitrag von SisterOfMercy »

Well, in the registry the value is a DWORD, so I used REG_DWORD for that. Have to look into it. :D
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: REG_DWORD entries in hex or decimal?

Beitrag 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
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: REG_DWORD entries in hex or decimal?

Beitrag 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.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: REG_DWORD entries in hex or decimal?

Beitrag 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
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Antworten