mjsr
mjsr

Reputation: 7590

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.

Upvotes: 0

Views: 2118

Answers (2)

swedishhousemafia
swedishhousemafia

Reputation: 129

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

Upvotes: 1

mjolinor
mjolinor

Reputation: 68341

Are you running the script with elevated permissions (i.e. did you start Powershell with "Run as Administrator"?

Upvotes: 0

Related Questions