AutomoxAutomox

Problem with worklet that manipulates registry

jesumyip
August 17, 2020 at 4:29 pm UTC

Hi all. I have a worklet that runs the following code in the remediation section. It doesn’t seem to be working. It works just fine if I run it in a powershell window (that runs as admin).

What gives? I’m trying to disable auto-startup of Starleaf.

6 lines
$registryPath = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder"
$registryProperty = "StarLeaf.lnk"
$enableValue = ([byte[]](0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00))
$disableValue = ([byte[]](0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00))

Set-ItemProperty -Path $registryPath -Name $registryProperty -Value $disableValue -Type Binary

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (1)

jesumyipAugust 17, 2020
#1

Figured out the problem with the help of support. OS bitness issue. The solution is to wrap the script in a scriptblock and use sysnative. 🙂

You can read more about it here https://support.automox.com/help/enforce-windows-registry-settings-worklet