学习了一下使用注册表可以新建一个右键的快捷方式,在深的路径我也不怕了
将以下代码复制到一个文本文件,然后保存成cmdCreate.reg,注意文件后缀是reg,注册表文件
我在提示使用了中文如果出现乱码改一下编码格式ANSI试试
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; http://www.sevenforums.com
; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="命令行(管理员)"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="命令行(管理员)"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="命令行(管理员)"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
双击运行,弹出确定对话框,点击确定,再右键,菜单里已经多出一个以管理员身份打开命令行窗口的选项。
如何去除:
假如哪天你不想要这个新加的选项了,请把下面的代码复制,同样保存到一个文本文件然后存为cmdRemove.reg,双击运行之。选项就会消失,菜单恢复正常。
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; http://www.sevenforums.com
; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
参考
http://blog.youkuaiyun.com/qq_19244423/article/details/46662293