Windows 右键打开 cmd

Windows 添加右键菜单快捷在当前目录打开 cmd

效果图

操作步骤

  1. 在任意位置新建一个文件(只要能粘贴文字的即可,如:.txt)将以下内容粘贴进去,保存好后,修改文件后缀(格式)为.reg,双击打开确认添加注册表,在任意目录下右键菜单都会出现如上图所示的在当前目录下打开具有管理员权限的cmd窗口
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    Windows Registry Editor Version 5.00

    [-HKEY_CLASSES_ROOT\Directory\shell\runas]

    [HKEY_CLASSES_ROOT\Directory\shell\runas]

    @="Open cmd here as Admin"

    "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]

    @="Open cmd here as Admin"

    "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]

    @="Open cmd here as Admin"

    "HasLUAShield"=""

    [HKEY_CLASSES_ROOT\Drive\shell\runas\command]

    @="cmd.exe /s /k pushd \"%V\""
  2. 修改文中的@="Open cmd here as Admin"双引号中的文字Open cmd here as Admin,即可修改添加的菜单项的名称
  3. 删除添加的菜单,同样的方法新建.reg后缀的文件,粘贴如下内容,双击执行即可
    1
    2
    3
    4
    5
    6
    7
    Windows Registry Editor Version 5.00

    [-HKEY_CLASSES_ROOT\Directory\shell\runas]

    [-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

    [-HKEY_CLASSES_ROOT\Drive\shell\runas]

评论

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×