管理员权限在当前目录快速打开cmd(命令行)窗口

将以下代码复制到一个文本文件,然后保存成cmdCreate.reg

双击运行,弹出确定对话框,点击确定,再右键,菜单里已经多出一个以管理员身份打开命令行窗口的选项。
提示使用了中文如果出现乱码改一下编码格式ANSI试试

 1 Windows Registry Editor Version 5.00
 2 
 3 ; Created by: Shawn Brink
 4 
 5 ; http://www.sevenforums.com
 6 
 7 ; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html
 8 
 9 [-HKEY_CLASSES_ROOT\Directory\shell\runas]
10 
11 [HKEY_CLASSES_ROOT\Directory\shell\runas]
12 
13 @="命令行(管理员)"
14 
15 "HasLUAShield"=""
16 
17 [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
18 
19 @="cmd.exe /s /k pushd \"%V\""
20 
21 [-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
22 
23 [HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
24 
25 @="命令行(管理员)"
26 
27 "HasLUAShield"=""
28 
29 [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
30 
31 @="cmd.exe /s /k pushd \"%V\""
32 
33 [-HKEY_CLASSES_ROOT\Drive\shell\runas]
34 
35 [HKEY_CLASSES_ROOT\Drive\shell\runas]
36 
37 @="命令行(管理员)"
38 
39 "HasLUAShield"=""
40 
41 [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
42 
43 @="cmd.exe /s /k pushd \"%V\""

假如哪天不想要这个新加的选项了,请把下面的代码复制,同样保存到一个文本文件然后存为cmdRemove.reg,双击运行之。选项就会消失,菜单恢复正常。

 1 Windows Registry Editor Version 5.00
 2 
 3 ; Created by: Shawn Brink
 4 
 5 ; http://www.sevenforums.com
 6 
 7 ; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html
 8 
 9 [-HKEY_CLASSES_ROOT\Directory\shell\runas]
10 
11 [-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
12 
13 [-HKEY_CLASSES_ROOT\Drive\shell\runas]

————————————————

版权声明:本文为CSDN博主「小英雄Dui」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ujsDui/article/details/79191921

posted @ 2022-02-23 15:58  37wjy  阅读(750)  评论(0编辑  收藏  举报