在目前目錄下快速以管理者權限打開cmd視窗
- 以管理者身份在目前目錄打開指令行視窗
以管理者身份在目前目錄打開指令行視窗
這裡要介紹如何在右鍵菜單裡添加一個菜單選項讓我們可以在一個檔案夾裡直接右擊滑鼠便可以管理者身份打開一個指令行視窗,那樣的話将會讓工作變得非常輕松。
将以下代碼複制到一個文本檔案,然後儲存成 cmd.reg,注意檔案字尾是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 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\""
然後輕按兩下運作,彈出确定對話框,點選确定,再右鍵一看,菜單裡已經多出一個以管理者身份打開指令行視窗的選項了。
如何去除:
假如哪天你不想要這個新加的選項了,請把下面的代碼複制,同樣儲存到一個文本檔案然後存為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]
轉載自:https://www.cnblogs.com/Wayou/p/3359993.html