1. 程式人生 > >任意位置以管理員身份打開CMD(命令提示符)

任意位置以管理員身份打開CMD(命令提示符)

registry bubuko 文檔 Edito runas forum 文件夾 str als

關於CMD這個東西,windows和linux還是有很大差別的,linux系統下可以在任意位置右鍵選擇在當前文件夾打開終端,而windows沒有這個功能,每次打開都是默認的位置,然後不停的cd。為了提升效率,添加以管理員身份在當前文件夾打開CMD至右鍵。

一、添加至右鍵

1.新建文本文檔,將下列腳本復制進去

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]

@="xxx" #名稱隨意,此三處最好一致

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

@="xxx" #同上,此三處最好一致

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

@="xxx" #同上,此三處最好一致

"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]

@="cmd.exe /s /k pushd \"%V\""
2.名稱隨意,將拓展名txt改為reg,雙擊運行

技術分享圖片

二、從右鍵刪除

1.新建文本文檔,將下列腳本復制進去

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]

2.名稱隨意,將拓展名txt改為reg,雙擊運行

(圖片就不放了,懶得截圖,反正就是右鍵沒有了那個打開CMD的選項)

任意位置以管理員身份打開CMD(命令提示符)