How to propagate a registry key from HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER

P

Pekkapek

[COLOR=rgba(51, 51, 51, 1)]Hello

I have a script that creates a registry key to HKEY_LOCAL_MACHINE (HKLM). I try to use the feature that duplicates a registry key from HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER.

The script is following.


[COLOR=rgba(153, 153, 136, 1)]# Create registry key for all users in HKCU (using registry key progation)[/COLOR][/COLOR]

[COLOR=rgba(74, 74, 74, 1)][COLOR=rgba(0, 128, 128, 1)]$regPath[/COLOR] = [COLOR=rgba(208, 16, 64, 1)]'HKLM:\SOFTWARE\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\Common\General'[/COLOR]
[COLOR=rgba(153, 153, 136, 1)]# Supress file format prompt[/COLOR]
[COLOR=rgba(0, 128, 128, 1)]$name[/COLOR] = [COLOR=rgba(208, 16, 64, 1)]"ShownFileFmtPrompt"[/COLOR]
[COLOR=rgba(0, 128, 128, 1)]$value[/COLOR] = 1
[COLOR=rgba(0, 134, 179, 1)]New-Item[/COLOR] -Path [COLOR=rgba(0, 128, 128, 1)]$regPath[/COLOR] -Force [/COLOR]

[COLOR=rgba(51, 51, 51, 1)][COLOR=rgba(0, 134, 179, 1)]New-ItemProperty[/COLOR][COLOR=rgba(74, 74, 74, 1)] [/COLOR][COLOR=rgba(0, 128, 128, 1)]$regPath[/COLOR][COLOR=rgba(74, 74, 74, 1)] -Name [/COLOR][COLOR=rgba(0, 128, 128, 1)]$name[/COLOR][COLOR=rgba(74, 74, 74, 1)] -Value [/COLOR][COLOR=rgba(0, 128, 128, 1)]$value[/COLOR][COLOR=rgba(74, 74, 74, 1)] -Force[/COLOR][/COLOR]


[COLOR=rgba(51, 51, 51, 1)]The propagation seems not working. I started Word but the key is not present in HKEY_CURRENT_USER.


76568d57-5855-4b03-a5cc-005a8362fd48?upload=true.jpg


I use Windows 10 Pro 64 bit. Any suggestions how to make the propagation to work?[/COLOR]

Continue reading...
 

Similar threads

L
Replies
0
Views
72
Luna Birdsong
L
I
Replies
0
Views
61
Ishan Kumar2222
I
D
Replies
0
Views
74
David Kafrissen
D
R
Replies
0
Views
108
Rich Cawley1
R
Back
Top Bottom