Create context-sensitive admin menus for right-click

0

I've got a right-click explorer menu that allows me to open a file in Notepad++, which works pretty good. Very convenient. It takes a small registry hack (HKEY_CLASSES_ROOT*\shell), but no worries... unless the file is in a protected folder requiring Admin access to write.

Is there a way to make a registry hack that allows me to right-click on a file and see an option to open the file in Notepad (I can figger out Notepad++) under administrative privileges? It's OK if I get prompted for the elevation confirmation, I just want to right click on the file and be able to edit it.

Jeremy Holovacs

Posted 2011-10-19T17:10:37.253

Reputation: 121

There is a reason that programs are no longer run as admin by default: if anything goes wrong (bug, user error, etc.), you want to limit the damage. In general, it is a bad idea to run anything as admin unless it is ABSOLUTELY necessary. Just save a copy somewhere else, and move that to the protected location when you are done. A bit of a hassle, yes, but it could potentially avoid a much larger problem later on down the road. That is my two cents. If you really want to do it anyway, just remember that I warned you. – None – 2012-12-17T00:28:54.850

I get that; I do. But on some right-click options, it marks it as an administrative privilege-using task. You have to allow it to run under elevated permissions. I want to do the same thing for a custom task that I created. – Jeremy Holovacs – 2012-12-19T12:45:33.337

Answers

1

You could try using the runas command as follows: runas /noprofile /user:SomeAdminUser notepad.exe %1 A CMD window will open asking for the password of SomeAdminUser, after which notepad will launch.

Suchipi

Posted 2011-10-19T17:10:37.253

Reputation: 854

0

You can use the SendTo submenu. Just put a shortcut in your SendTo folder that names the program and elevation status desired in its Properties.

kreemoweet

Posted 2011-10-19T17:10:37.253

Reputation: 3 884