/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Kace setting registry values around wow6432node

07/30/2020 328 views

Is there any way in the kscript to set a registry value and not automatically redirect through the WOW6432NODE?  Most of the time going through wow6432node is fine.  But not this case.

0 Comments   [ + ] Show comments

Comments


All Answers

0

To access the 64bit HKEY_LOCAL_MACHINE you would use HKLM64 instead of the typical HKLM.

https://support.quest.com/kace-systems-management-appliance/kb/111236/how-to-use-windows-64bit-32bit-redirects

Answered 07/30/2020 by: KevinG
7th Degree Black Belt

  • This results in:

    ====

    07/31/2020 13:00:47 - Scanning HKLM64:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\

    Get-ChildItem : Cannot find drive. A drive with the name 'HKLM64' does not exist.
    At C:\ProgramData\Quest\KACE\scripts\1133\DeleteBomgar.ps1:37 char:1
    + Get-ChildItem $paths |
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (HKLM64:String) [Get-ChildItem], DriveNotFoundExcept
    ion
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

    ====


    I suspect this is because the 32-bit version of Powershell is being called, and it doesn't recognize the "HKLM64" nomenclature. The (seven-year old) article linked above eventually leads to this advice: "If you are executing against a x64 system you will want to call c:\windows\sysnative\powershell.exe to make sure you are executing the 64bit version of PowerShell...". Of course, that neutralizes version 10.2.234's new "we now run Powershell scripts directly" feature; perhaps a checkbox on Powershell scripts to select this option would be in order.
    • UserVoice!!
      https://kace.uservoice.com/
      • Done: https://kace.uservoice.com/forums/82699-sma-k1000/suggestions/41092018-universal-script-language-in-editor-via-option-to
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ