If a worklet returns the error "Requested registry access is not allowed," or a script that reads or writes the registry works when you run it locally but not from a worklet, there are two common causes: the registry key's permissions, and the fact that worklets run in a 32-bit context. Work through both.
Check the registry key permissions
If you are trying to edit registry keys on your devices and getting "Requested registry access is not allowed," start by checking the permissions for the registry key. In the Registry Editor, select a hive or key and click Edit > Permissions to see the current settings.
Automox runs as SYSTEM and requires Full Control to make these changes through a worklet, so make sure that is checked in the Allow column for the SYSTEM account. It is also possible that a GPO is imposing permission restrictions, so be sure to check those as well.
Account for the 32-bit worklet context
Automox worklets run PowerShell as a 32-bit process (as SYSTEM). On 64-bit Windows, a 32-bit process is subject to registry redirection: references to HKLM\SOFTWARE are redirected to HKLM\SOFTWARE\Wow6432Node. This is why a script that works when you run it locally in 64-bit PowerShell can fail, or read and write the wrong location, when it runs from a worklet.
To run your registry logic in native 64-bit PowerShell, relaunch it through the sysnative path:
$scriptBlock = {
# your registry code here
}
$exitCode = & "$env:SystemRoot\sysnative\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -WindowStyle Hidden -NoProfile -NonInteractive -Command $scriptBlock
Exit $exitCodeThe sysnative alias is only visible from a 32-bit process, which is what makes it resolve to 64-bit PowerShell. For the full pattern and caveats, see Using 64-bit PowerShell Code with Automox.
Because worklets run as SYSTEM, HKCU refers to the SYSTEM account's profile, not the logged-in user's. To reach a specific user's keys, load that user's hive explicitly rather than relying on HKCU.
The same 32-bit behavior affects file paths. See PowerShell Script Works Locally but Can't Find Filepath in a Worklet.