Action Script Failure due to Relevance Substitution Error

Any Help with this would be greatly appreciated:

Here is the Action Script Code:
if {((not exists key “HKEY_USERS.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel” of registry) OR (not exists value “{59031a47-3f72-44a7-89c5-5595fe6b30ee}” of key “HKEY_USERS.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel” of registry) OR (value “{59031a47-3f72-44a7-89c5-5595fe6b30ee}” of key “HKEY_USERS.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel” of registry != 0))}
regset “[HKEY_USERS.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]” “{59031a47-3f72-44a7-89c5-5595fe6b30ee}”=dword:0
endif

Hello!

The issue here is likely associated with the curly brackets ( { } ) in the regset command. See Tip: Escaping curly brackets for substitutions in ActionScript for more information and guidance.

1 Like

Agree the script is failing because of the curly-bracket escapes that are needed, but I also think this will probably not do what you expect.

The HKEY_USERS\.Default hive is not the Default Profile used when new users log on. It’s the profile of the LocalSystem account. See https://devblogs.microsoft.com/oldnewthing/20070302-00/?p=27783 for details.

To make a change that applies to all User Profiles, I’d recommend using Local Group Policy (example https://bigfix.me/fixlet/details/26933), or Startup/Logon Script, or ActiveSetup (example Action That Runs Once per User ) , or (worst-case) use ‘reg load’ to load the ntuser.dat to a new Hive, update that Hive, and then use ‘reg unload’ to unload the ntuser.dat for the Default User profile.

1 Like

Thank you for your quick response, this solved my issue and it took doubling the braces in several locations to make it work, here is the final code that worked:

if {((not exists key "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" of registry) OR (not exists value "{{59031a47-3f72-44a7-89c5-5595fe6b30ee}}" of key "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" of registry) OR (value "{{59031a47-3f72-44a7-89c5-5595fe6b30ee}}" of key "HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" of registry != 0))}
	regset "[HKEY_USERS\.DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]" "{{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:0
endif
1 Like