Take ownership of registry key via registry script?

1

I have come across some registry edits/hacks I'd like to make. however, it appears that you have to take control of some registry keys before you can make the edit. In the articles, this is a manual process, though VG does go into some other options.

However, I'd like to be able to run 1 .reg file to accomplish 1 task, including taking ownership of the registry key I am trying to modify or add. Is that possible?

If that's not possible, then how likely is it that I can drop out to Power Shell to perform the take ownership and registry key? I know Power Shell can do the latter, but I'm not sure about the former. In this case, have 1 script file is my goal, even if it isn't a .reg script, but a Power Shell one.

YetAnotherRandomUser

Posted 2017-06-24T14:06:16.287

Reputation: 1 494

Take Ownership (Permission) of Registry Keys from Command Line – DavidPostill – 2017-06-24T14:13:25.750

I linked to that in the OP. Those options are not related to a registry file; they are command line programs that won't work in a registry file. Some of the programs have to be downloaded. – YetAnotherRandomUser – 2017-06-24T14:23:09.327

1You can't change registry permissions using a .reg file, but you can change the registry using a .bat file. So the entire thing can be scripted in a .bat file, thats what @DavidPostill means by referring to that link. – LPChip – 2017-06-24T14:25:31.200

1Exactly what @LPChip said. – DavidPostill – 2017-06-24T14:41:35.293

You have to change the permissions first or the reg file will fail. – DavidPostill – 2017-06-24T14:53:48.353

Changing Permissions in the Registry shows you how to do it with PowerShell. – DavidPostill – 2017-06-24T14:56:28.153

So, it sounds like at least I can do it all in one file. That's cool. – YetAnotherRandomUser – 2017-06-24T16:00:56.167

No answers