Invoke-HKCURegistrySettingsForAllUsers Not Applying to All User Profiles

I am trying to use the Invoke-HKCURegistrySettingsForAllUsers when installing an Adobe Reader update on Windows 10 x64. It is applying the updated registry keys in the current HKCU profile that I run PSADT in. It is not applying them to either the existing or a new profiles on the machine. I am using PSADT 3.6.9. There are no errors reported in ISE

[scriptblock]$HKCURegistrySettings = {
Set-RegistryKey -Key ‘HKCU:SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723’ -Name ‘NoOpenWith’ -Value ‘’ -Type String -SID $UserProfile.SID
Set-RegistryKey -Key ‘HKCU:SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723’ -Name ‘NoStaticDefaultVerb’ -Value ‘’ -Type String -SID $UserProfile.SID
Set-RegistryKey -Key ‘HKCU:SOFTWARE\Classes\AppX4hxtad77fbk3jkkeerkrm0ze94wjf3s9’ -Name ‘NoOpenWith’ -Value ‘’ -Type String -SID $UserProfile.SID
Set-RegistryKey -Key ‘HKCU:SOFTWARE\Classes\AppX4hxtad77fbk3jkkeerkrm0ze94wjf3s9’ -Name ‘NoStaticDefaultVerb’ -Value ‘’ -Type String -SID $UserProfile.SID
}
Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings`

Any ideas?

Thanks

Hi,

Why not doing an active-setup?

I read lots of posts that claimed PSADT Invoke-HKCURegistrySettingsForAllUsers the best way to go. Easier… and it sounds like it would be if I could get it to work. Do you see anything wrong in my code?

You’re not setting any values? Are you trying to remove the existing values?

I am trying to create new 4 values (1607) as listed above to stop Edge from highjacking file associations (PDF and HTM). My hope was to drop these reg keys and then proceed with my Acrobat Reader update. I did try active-setup and it appears to work as advertised. Are you able to test on a Windows 10 x64 with PSADT 3.6.9 and see if nvoke-HKCURegistrySettingsForAllUsers works in all profiles (existing and new) on your machine?

Hi,

PSADTK Active setup is using Invoke-HKCURegistrySettingsForAllUsers. So yes, you will have to set an active-setup.

Active-setup is run before the load of the shell if it is a problem then you would need to set a run once and then building it with Invoke-HKCURegistrySettingsForAllUsers.

Make it easy for you and use an active-setup.

There are no values.

Once I changed the value from the single double quote to ‘1607’ and removed the single quote at the end of the last line it worked fine. It set the values for all existing users including default user.

Jim

That is great news. I am not sure I am following what you did to resolve the issue. Please give me an example of the changes you made with my code.

Your code:

Set-RegistryKey -Key ‘HKCU:SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723’ -Name ‘NoOpenWith’ -Value -Type String -SID $UserProfile.SID

Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings`

My code:

Set-RegistryKey -Key ‘HKCU:SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723’ -Name ‘NoOpenWith’ -Value ‘1607’ -Type String -SID $UserProfile.SID

Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings

Ok.

On the line with the ‘NoOpenWith’ -Value ‘1607’ -Type String -SID $UserProfile.SID where you added ‘1607’ maybe adding that value was the fix? Unfortunately the key needs to be null per many posts (see below) I think. Is using ‘’ for a null value incorrect?

The other weird character ` at the end of my code got added when I tried to use the code tags on this page. It was not in my actual code.

In a previous post I asked if you were trying to remove values and you said, “I am trying to create new 4 values (1607)”. That’s where I got the 1607 from…

I think the problem is you have (one) double-quote for your value: -Value ”. What you should have is (2) single-quotes: -Value ‘’.

Or maybe you had single quotes and the site changed them to double? If that’s the case, then I’m not sure what the issue is.

Sorry for the confusion. 1607 is the build of Windows 10 I am using. I am definitely trying to add keys. The key have no value.

[HKEY_CURRENT_USER\Software\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723]
“NoOpenWith”=""
“NoStaticDefaultVerb”=""

And you are correct I am using 2 single quotes but the site makes it look like 1 double.