How do you force SLREGWRITEVAL to write to 64bit registry? - Desktop Authority Management Suite (DAMS) - Desktop Authority - Dell Community

How do you force SLREGWRITEVAL to write to 64bit registry?

How do you force SLREGWRITEVAL to write to 64bit registry?

This question is answered

I posted this question on the ITNINJA Desktop Authority forum last week.  I'd forgotten that Dell opened this Forum last year. 

--------

You would think that it would be as easy as using the KIX SETOPTION "WOW64ALTERNATEREGVIEW" command.  However, it appears that the Desktop Authority API function SLREGWRITEVAL ignores it and continues to write to the 32bit registry.  I haven't checked any of the other DA API registry functions.

With $RC = SETOPTION("WOW64ALTERNATEREGVIEW","ON") or $RC = SETOPTION("WOW64ALTERNATEREGVIEW","OFF")

The script command  : $rc=slregwriteval("HKLM\Software\Scriptlogic\LocalMachine", "ComputerType", "Desktop", "REG_SZ")

Returns the following in the slTrace : sub> slRegEdit: Action=[WriteValue] Key=[HKLM\Software\Scriptlogic\LocalMachine] Value=[ComputerType] Data=[Desktop] Type=[REG_SZ] Force32=[1]

Looks like there should be a 5th parameter passed to the function that would change "Force32=0".  Maybe some undocumented variable?  $slRegForce32=0?

I hadn't run into this before since all my scripts using the functions are reading and writing to the 32bit area of HKLM. (HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node).

Any input would be appreciated.  Yes, I've opened a support request with Dell and I'll let you know when I hear from them.

Dave

-------------------------------

I did hear back from Dell Support.  They said that the way to accomplish this was to use the API Function slEdit and the undocumented 7th field $Use32bitKey.

However, when I tried it I found that it made no difference.  "Force32=1" remained and my updates continued going to the 32bit registry.

slRegEdit($Action, $RegKey, OPTIONAL $RegVal, OPTIONAL$RegExp, OPTIONAL $RegTyp, OPTIONAL $NoDebug, OPTIONAL $Use32bitKey)

Action can be “ReadValue”, “WriteValue”, etc.

Set $Use32bitKey to 0 ot 1 depending on your needs.

Does this work for anyone else?

Dave

Verified Answer
  • The issue described in this posting was resolved through a case.

    We discovered during troubleshooting that the underlying problem was in writing to the ScriptLogic key of the registry.  The pre-engine or post-engine script object is forcing the 32 bit location when the ScriptLogic key or a subkey of ScriptLogic is targeted. 

    Therefore, our recommendation was to use the syntax below and to write to any other key in the registry other than the ScriptLogic key (or subkeys) and it should successfully and consistently write to the desired 64 bit location. 

    $rc=slRegEdit('WriteValue', 'HKLM\SOFTWARE\TestKey', 'TestValue', 'shouldbe64', 'REG_SZ',0,0) 

All Replies
  • The issue described in this posting was resolved through a case.

    We discovered during troubleshooting that the underlying problem was in writing to the ScriptLogic key of the registry.  The pre-engine or post-engine script object is forcing the 32 bit location when the ScriptLogic key or a subkey of ScriptLogic is targeted. 

    Therefore, our recommendation was to use the syntax below and to write to any other key in the registry other than the ScriptLogic key (or subkeys) and it should successfully and consistently write to the desired 64 bit location. 

    $rc=slRegEdit('WriteValue', 'HKLM\SOFTWARE\TestKey', 'TestValue', 'shouldbe64', 'REG_SZ',0,0)