New
#1
How do I use PowerShell commands to change Permissions for a Registry?
Hi, everyone
My main objective is make the registry key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2"
more safer and not auto run programs.
Secondly, I hoped the PowerShell command codes could batch run them automatically.
Protected the registry key before:
After protected the registry key:
I had some PowerShell command codes about the aforementioned registry key.
$path = "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2"
$Acl = Get-ACL $path
$AccessRule= New-Object System.Security.AccessControl.RegistryAccessRule("Everyone","FullControl","Deny")
$Acl.SetAccessRule($AccessRule)
Set-Acl $path $Acl
Q.Could you please help me to correct them and tell me what command codes used to batch run them automatically.
Thanks a lot.