Regset for REG_DWORD

(imported topic written by Edj)

I currenlty creating a task to modify the Java Update settings. The relevancy within the if/else/elseif statement works without a flaw but i am having issues setting the “DWORD”. When I execute the task below, it modifies the regkey but it converts it from a “REG_DWORD” to a “REG_SZ”. Please assist.


if {exist key “HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy” whose ( value “EnableAutoUpdateCheck” of it =1) of registry}

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy

" “EnableAutoUpdateCheck”="{0 as integer as hexadecimal}"

else

endif


Thanks,

Edj

(imported comment written by SystemAdmin)

Hi Edj,

The inspector help file has a good example on how to set DWORD values:

http://support.bigfix.com/fixlet/documents/Inspector_Help.chm

Examples
 
regset "[HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security]" "Level"=dword:00000002
 
This example sets the Level value of the specified registry to a double-word 2.

Also, as a matter of style in creating an action script it is better form to move the relevance of your action to the relevance of a Fixlet since you don’t have an ‘else’ clause. Ie, it is logically equivalent but you’ll get better behavior from the system by moving the relevance out of the action script.

(imported comment written by Edj)

Tyler,

Thanks, That did it. I initially tried the “dword:00000000” entry but I included quotes. I beleive that this may have been the problem.

Thanks Again,

Edj

(imported comment written by brolly3391)

Hey Edj,

As a nifty side note, we use the windows syntax for RegSet, so if you do a registry export, you can see how to do the other value types:

RegSet "

HKEY_CURRENT_USER\Software\test

" “StringValue”=“String”

RegSet "

HKEY_CURRENT_USER\Software\test

" “BinaryValue”=hex:10,00,10,10,11,10,00,01,00,00,00,11,10,10

RegSet "

HKEY_CURRENT_USER\Software\test

" “Dword”=dword:00001234

RegSet "

HKEY_CURRENT_USER\Software\test

" “MultiString”=hex(7):73,00,74,00,72,00,69,00,6e,00,67,00,31,00,00,00,73,00,74, 00,72,00,69,00,6e,00,67,00,32,00,00,00,73,00,74,00,72,00,69,00,6e,00,67,00,33,00,00,00,00,00

RegSet "

HKEY_CURRENT_USER\Software\test

" “Expand”=hex(2):65,00,78,00,70,00,61,00,6e,00,64,00,20,00,6d,00,65,00,20,00,6e,00,6f,00,77,00,3b,00,20,00,70,00,6c,00,65,00,61,00,73,00,65,00,00,00

Cheers,

Brolly

(imported comment written by Edj)

Thanks Brolly

Ed