Search code examples
windowspowershellregistrycmd

how can i delete an acl rule from a registry key using the command line


I would like to know how to delete a "Deny rule" that makes imposible to modify a register key, using the command line.

Context:

In windows every file extension association resides in:

HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

For instance the default app for .mp4 files is managed in:

HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mp4\UserChoice

The Userchoice key has a deny permission above all other permisions. The following picture shows what I mean: enter image description here

I have tried with Powershell using set-acl but due the same deny Deny rule I can't modify anything of that key.

Why all this? I was creating a script to define easily through command line the default app for an specific extension. The change in the registry is a must to make this works.


Solution

  • Have you tried non-Microsoft solutions? Give http://helgeklein.com/setacl/documentation/command-line-version-setacl-exe/ a go.