Unless your company decided to deploy only 32 bit OS versions, you most probably have encountered some problems trying to figure out where a specific registry entry will end up being written to when you deploy it via Sccm.

.

If you compare the registry hives of Windows 32 and 64 bits systems, you will easily see that some additional entries are present:

HKLM\SOFTWARE\MYapp (64 bits native app)

HKLM\SOFTWARE\Wow6432Node\Myapp (32 bits ‘Redirected’ App)

.

So, let’s deploy a reg key in HKLM\SOFTWARE\MYapp on a 64 bits System.

A common program would be     REG ADD HKLM\SOFTWARE\MYapp

.

When you run this via the command line, it writes at the expected location. But when you try to run this same command via SCCM, it writes it under the Wow6432Node hive…!

The issue is the client is a 32bits application that will be redirected to the Wow6432Node by the OS.

Here is a list of examples and workarounds. I use always the same key, as well as a reg file in the following format for application with import tools.

.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\MYapp]

.

1. You apply the changes from the command line (without SCCM Client)

.

The following commands will write to the 64 bits hive

.

[HKLM\SOFTWARE\MYapp]

REG ADD HKLM\SOFTWARE\MYapp

REG ADD HKLM\SOFTWARE\MYapp /reg:64

C:\Windows\System32\REG ADD HKLM\SOFTWARE\MYapp

C:\Windows\System32\REG ADD HKLM\SOFTWARE\MYapp /reg:64

REGEDIT /s MYapp.reg

C:\Windows\REGEDIT /s MYapp.reg

.

The following commands will write to the 32 bits redirected hive

.

[HKLM\SOFTWARE\Wow6432Node\MYapp]

REG ADD HKLM\SOFTWARE\MYapp /reg:32

C:\Windows\System32\REG ADD HKLM\SOFTWARE\MYapp /reg:32

C:\Windows\Syswow64\regedit /s MYapp.reg

.

2. You apply the changes via a SCCM Package ( SCCM Client on 64 Bits Operating System)

.

The following commands will write to the 64 bits hive

.

[HKLM\SOFTWARE\MYapp]

REG ADD HKLM\SOFTWARE\MYapp /reg:64

%windir%\SysNative\REG ADD HKLM\SOFTWARE\MYapp  (thanks to Pete Wilson for this information – see comment below)

.

The following commands will write to the 32 bits redirected hive

.

[HKLM\SOFTWARE\Wow6432Node\MYapp]

REG ADD HKLM\SOFTWARE\MYapp

REG ADD HKLM\SOFTWARE\MYapp /reg:32

C:\Windows\System32\REG ADD HKLM\SOFTWARE\MYapp

C:\Windows\Syswow64\REG ADD HKLM\SOFTWARE\MYapp

REGEDIT /s MYapp.reg

C:\Windows\REGEDIT /s MYapp.reg

C:\Windows\Syswow64\REGEDIT /s MYapp.reg

.

3. You apply the changes via a SCCM Task Sequence

.

The following commands will write to the 64 bits hive

.

[HKLM\SOFTWARE\MYapp]

REG ADD HKLM\SOFTWARE\MYapp Only When checkbox ‘Disable 64-bit file system redirection is CHECKED

C:\Windows\REGEDIT /s MYapp.reg Only When checkbox ‘Disable 64-bit file system redirection is CHECKED

.

The following commands will write to the 32 bits redirected hive

.

[HKLM\SOFTWARE\Wow6432Node\MYapp]

REG ADD HKLM\SOFTWARE\MYapp Only When checkbox ‘Disable 64-bit file system redirection is UNCHECKED

C:\Windows\REGEDIT /s MYapp.reg Only When checkbox ‘Disable 64-bit file system redirection is UNCHECKED

 .

4. You apply the changes via a MSI packaged Application

.

When using MSI, the path that will be used is set at the Component level.

If you set the property of the component ’64-bit’ to YES it will write to the 64 bit path, otherwise it will be redirected.

Note that when using SCCM to deploy MSI files, there is no side effect so the same applies.

64bit component

I hope this clarifies what is needed for your settings to be applied at the correct location.

Advertisements