2

I want to run regedit as a different user (i.e. to edit that user's registry entries).

So I've run cmd as an Administrator, then did

runas /profile /savecred /user:OtherUserName regedit

It asks for my password but after I type it in, I get

RUNAS ERROR: Unable to run - regedit

740: The requested operation requires elevation.

I understand that regedit has to be run as an administrator, but I am running the command prompt as administrator. OtherUserName is an Administrator type user.

I'm guessing that even though I'm running for the current user as administrator, my acceptance of that doesn't pass over to OtherUserName.

But this is something I am able to do in Windows 7 Embedded.

I've tried:

komodosp
  • 245
  • 1
  • 5
  • 17
  • If you want to edit the users registry just check `HKEY_Users` or manually open the hive for the user. – Seth Feb 27 '19 at 12:41
  • Have you checked permissions for `regedit.exe`? – montonero Feb 27 '19 at 13:10
  • Try to add the parameter `/netonly` to the `runas` command. – harrymc Feb 27 '19 at 17:10
  • Permissions for regedit.exe are fine, if I log in as `OtherUserName` I can run it fine. (They are also an administrator user). Tried `/netonly` but didn't work. As for `HKEY_Users` I need to put this into a .bat file / .reg file so that wouldn't be easy but I think I've managed to find a way around it - though I'm still puzzled why I can't `runas ... regedit` – komodosp Feb 28 '19 at 08:43

2 Answers2

0

OK so I believe I've found a way around it, thanks to this page... https://www.itechtics.com/edit-registry-settings-other-users/

reg load HKU\OtherUserName C:\Users\OtherUserName \ntuser.dat

then

regedit

then there is a node

[HKEY_USERS\OtherUserName\...etc.]

in the registry settings.

It solves the problem for me, though it still doesn't answer the overall question of why I can't runas an application requiring elevated permissions...

komodosp
  • 245
  • 1
  • 5
  • 17
0

It is working when used with cmd:

runas /user:domain\login "cmd /c ^c:\windows\regedit.exe^"

runas error 740: The requested operation requires elevation and cmd /c? - Windows Forum