Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I like to add a shell context menu for registering .dll files using the command

%windir%Microsoft/Framework/v2.0.50727/regasm.exe "%1" /codebase

which used to work fine in XP. However in Windows 7 this command requires administrator privileges. Is there some way I can make this command run as administrator?

share|improve this question
    
Why do you want to do that in the GUI? Are you having to do this often for some reason? Why don't you just open a CMD prompt as admin and so it from there? –  paradroid Sep 17 '10 at 15:36
    
yes I have to do it often, as I switch from building source code from one branch to the other and need to register various files, and I don't want to have the hassle of opening a cmd prompt navigating to the folder for the regasm command and then typing the full path of the file to register, which can be long –  Sam Holder Sep 17 '10 at 18:39
    
Why not use the hidden Administrator account when doing this kind of work. cmd...net user administrator /active:yes...log off and you can now log into the real admin account. –  Moab Sep 17 '10 at 19:25
    
@Moab, I'm and administrator on the machine already. And logging on and off seems like a hassle to do this. –  Sam Holder Sep 23 '10 at 9:19
    
In windows7 user accounts are not like the hidden Admin account, so you are not really the true admin while in a user account like you were in XP. –  Moab Sep 23 '10 at 16:52

1 Answer 1

up vote 1 down vote accepted

To do this, you need this command to launch using the Shell verb "runas".

You can download a reg file here.

http://www.winhelponline.com/blog/register-dlls-elevated-using-the-context-menu/

REGEDIT4

;Register modules (Elevated) from the context menu
;March 25, 2008 - (c) 2008 Ramesh Srinivasan
;http://www.winhelponline.com
;http://www.winhelponline.com/blog/

[HKEY_CLASSES_ROOT\dllfile\shell]
@="none"

[HKEY_CLASSES_ROOT\dllfile\shell\runas]
@="&Register (as Administrator)"

[HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
@="regsvr32.exe \"%1\""


[HKEY_CLASSES_ROOT\ocxfile\shell]
@="none"

[HKEY_CLASSES_ROOT\ocxfile\shell\runas]
@="&Register (as Administrator)"

[HKEY_CLASSES_ROOT\ocxfile\shell\runas\command]
@="regsvr32.exe \"%1\""
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.