我可以让 shell 上下文操作以管理员身份运行吗?

Sam*_*der 5 windows-7 privileges shell administrator context-menu

我喜欢添加一个 shell 上下文菜单来使用命令注册 .dll 文件

%windir%Microsoft/Framework/v2.0.50727/regasm.exe "%1" /codebase
Run Code Online (Sandbox Code Playgroud)

以前在 XP 中工作正常。但是在 Windows 7 中,此命令需要管理员权限。有什么办法可以让这个命令以管理员身份运行吗?

sur*_*asb 4

为此,您需要使用 Shell 动词“runas”来启动此命令。

您可以在此处下载 reg 文件。

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\""
Run Code Online (Sandbox Code Playgroud)