2

As an example, I'm trying to apply the main answer from How do I change "Open with Powershell" to "Open with Command Prompt" when shift-rightclicking in Explorer?.

I'm the only user of the computer, and administrator. In good Win7 days, I would just open regedit.exe and edit the key.

Now in Win10, even if I start regedit.exe as administrator, it seems I cannot rename HKEY_CLASSES_ROOT\Directory\shell\cmd\HideBasedOnVelocityId without a long process and/or using a third party tool like regownershipex.

I can't imagine doing this each time I want to edit a registry key.

Question: how to, as an admin, bypass the Win10 registry ownership rules, and edit the registry "normally" without having to use a tool like regownershipex?

Even if I should disable some security features, it's fine, but I don't want every registry tweaking to become a long task - I want to keep it simple and stupid like in Windows 7. How to do this?

Basj
  • 2,143

1 Answers1

1

To be able to run regedit or a script as TrustedInstaller and so have full permissions on all registry keys, one could use AdvancedRun that allows running as System or TrustedInstaller.

For more information see the article
How to run Command Prompt as TrustedInstaller on Windows 11.


If you need to take ownership repeatedly of only a few specific keys that are owned by TrustedInstaller, you could create a script to do the task. Or two scripts to change the ownership and later undo it.

One command-line tool that is useful here is SetACL.

The following (untested) commands could do that when Run as Administrator :

SetACL.exe -on "HKEY_CLASSES_ROOT\Directory\shell\cmd" -ot reg -actn setowner -ownr "n:Administrators"
SetACL.exe -on "HKEY_CLASSES_ROOT\Directory\shell\cmd" -ot reg -actn setowner -ownr "n:nt service\trustedinstaller" -rec Yes

These commands were based on information from the article Take Ownership of Registry Key & Assign Permissions Using Command-line. You will find more information in the article itself.

harrymc
  • 498,455