Unable to set dword value on Windows Update registry hive

I have been trying to modify the value of “RestartNotificationsAllowed2” but it does not seem to change. I have been using the script below on other registry hive and it was working before.

delete __createfile
delete setup.reg

createfile until end-reg-edit-commands
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings]
“RestartNotificationsAllowed2”=dword:00000001

end-reg-edit-commands

move __createfile setup.reg
wait regedit /s setup.reg

delete __createfile
delete setup.reg

====================================

The below command also does not work though I can execute it via CMD just fine.

wait cmd /c REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v RestartNotificationsAllowed2 /t REG_DWORD /d 1 /F

Let me know if you have a better way to update this path.
Thanks.

I would just use native actionscript. https://developer.bigfix.com/action-script/reference/registry/regset64.html

regset64 “[HKEY_LOCAL_MACHINE\Microsoft\WindowsUpdate\UX\Settings]” “RestartNotificationsAllowed2”=dword:00000001

3 Likes

In both of these cases, I think the root problem is that the BESClient runs in 32-bit mode by default, so these values would actually be written to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WindowsUpdate\UX\Settings

To stop the 32-bit redirection, include the ActionScript command

action uses wow64 redirection false

…on any line before executing the ’wait’ command.

2 Likes

Thank you this worked! :slight_smile:

1 Like

This one actually worked too, thanks a lot for providing the reason behind why it was not working using my previous script.

This actionscript actually does disable WOW redirection behind the scenes for that specific command context only.

This is implied by regset64 and regdelete64

I do prefer using the regset commands since they are much cleaner than doing manual reg files, but either works.