当前目录管理员身份运行
最后更新于:2022-04-02 03:46:02
[TOC]
> [参考](https://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html)
## 创建运行管理员菜单
运行`cmd.reg` ## 取消菜单
运行 `remove.reg`
';
cmd.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\shell\runas] @="Open command window here as Administrator" "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 command window here as Administrator" "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 command window here as Administrator" "HasLUAShield"="" [HKEY_CLASSES_ROOT\Drive\shell\runas\command] @="cmd.exe /s /k pushd \"%V\"" [-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas] [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas] "HasLUAShield"="" @="Open command window here as Administrator" [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas\command] @="cmd.exe /s /k pushd \"%V\"" ```运行`cmd.reg` ## 取消菜单
remove.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] [-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas] ```运行 `remove.reg`