/build/static/layout/Breadcrumb_cap_w.png

K1000 Writing to 64 bit registry rather than 32bit

I started setting up a kscript to deploy some software settings via the registry.

I am just using the built in regisrty options not a batch file.

The problem I am experiencing is that on a 64-bit system when kace is told to write to HKEY_LOCAL_MACHINE\SOFTWARE\SoftwareTitle it instead writes to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\SoftwareTitle

 

is there a way to force this to write to the correct section of the registry? The software doesnt look at the location that is being written to.

 

Any help is appreciated, thanks


0 Comments   [ + ] Show comments

Answers (3)

Answer Summary:
Posted by: SMal.tmcc 11 years ago
Red Belt
3

in the configuation policy use HKLM64


Comments:
  • make sure you set this script to work for only 64 bit OS's under the os versions
    btw your question statement is backwards, your script is writing to the 32 bit portion of the registry WOW6432NODE is the 32 bit area on a 64bit machine - SMal.tmcc 11 years ago
    • Hello. I'm trying to run this script. Having HKLM in the script kills the script running against 64bit machines. If I take out the registry checks it does run the command. If I add HKLM64 it dies as well. What should my exact syntax here be? Thank you.

      $userops = Get-ItemProperty -Path 'HKLM64:\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform' -Name 'UserOperations'

      if($userops.UserOperations -eq 0)
      {
      Set-ItemProperty -Path 'HKLM64:\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform' -Name 'UserOperations' -value 1
      Get-Date > C:\userops.txt
      echo "`nThe MS Office reg key was originally zero, it was changed to one:`nHKLM64:\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform\UserOperations" >> C:\userops.txt
      cmd.exe /C 'C:\Program Files\Common Files\Microsoft Shared\OFFICE14\osaui.exe' /f
      }

      else {out-null} - bens401 9 years ago
Posted by: Val53 1 year ago
White Belt
0

I have solution to add HKLM64 from kace 32 bit agent via batch

Just use psexec64 + cmd reg add command

I package .bat + psexec64 file executable in zip file


Exemple to disable 3cx startup in regitry:


@echo off

cd /d %~dp0

PsExec64.exe -accepteula reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /t REG_BINARY /v "3CXDesktopApp" /d 030000002cfbe40ce1e7d901 /f




Posted by: isudothings 7 years ago
Senior Purple Belt
0
Should be a simple process. You can add this to your powershell script (at the top line of the script) to relaunch PS in x64 if invoked from x86, as KACE will do as a 32bit binary. Then finish your script as you would normally, and it should write to x64 instead.

if ($PSHOME -like "*syswow64*") {
    Write-Output "Relaunching x64"
    & (Join-Path ($PSHOME -replace "syswow64", "sysnative") powershell.exe) `
        -File $Script:MyInvocation.MyCommand.Path `
        @args
    Exit
}
# Begin Script 
{do stuff}

Comments:
  • That is correct, it works. Kace agent is still 32bit only, and doesn't seem Kace cares to transfer it to 64bit or at least provide both as an option. I wonder what the status of that is? - bens401 7 years ago
 
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