您的位置:首頁(yè) > 軟件資訊 > 編程技巧 > 操作系統(tǒng)
來(lái)源:北大青鳥(niǎo)飛迅校區(qū)|發(fā)布時(shí)間:2013-05-03 10:14:18
此文僅限于對(duì)經(jīng)常需要打開(kāi)命令行并且感到正常打開(kāi)命令行方式很浪費(fèi)時(shí)間的人.
正常情況下我門需要打開(kāi)CMD, 然后再CD到自己需要的目錄, 這對(duì)偶爾用用的人倒沒(méi)什么. 但是經(jīng)常需要這么些操作就感到浪費(fèi)了大把時(shí)間. 現(xiàn)在提供兩種方式讓你像在linux中那樣更高效的在當(dāng)前目錄打開(kāi)命令行.
方式一:
在當(dāng)前目錄按Shift+鼠標(biāo)右鍵, 你就可以看到類似的在此處打開(kāi)命令行的選項(xiàng)了, 如果你想去掉shift,直接按鼠標(biāo)右鍵就有此選項(xiàng), 那么你需要用簡(jiǎn)單的修改下你的注冊(cè)表,
去注冊(cè)表位置HKEY_CLASSES_ROOTDirectoryshellcmd 下面將Extended鍵值刪掉, 如果你還希望驅(qū)動(dòng)器和桌面也能這樣, 將HKEY_CLASSES_ROOTDrivershellcmd和
HKEY_CLASSES_ROOTDirectoryBackgroundshellcmd 下的Extended鍵值去掉即可.
方式二:
用快捷鍵,當(dāng)然會(huì)用到人見(jiàn)人愛(ài)的Autohotkey. 其Auothotkey代碼如下:
SetTitleMatchMode RegEx
return
; Stuff to do when Windows Explorer is open
;
#IfWinActive ahk_class ExploreWClass|CabinetWClass
; open ‘cmd’ in the current directory
;
#c::
OpenCmdInCurrent()
return
#IfWinActive
; Opens the command shell ‘cmd’ in the directory browsed in Explorer.
; Note: expecting to be run when the active window is Explorer.
;
OpenCmdInCurrent()
{
; This is required to get the full path of the file from the address bar
WinGetText, full_path, A
; Split on newline (`n)
StringSplit, word_array, full_path, `n
; Take the first element from the array
full_path = %word_array1%
; strip to bare address
full_path := RegExReplace(full_path, “地址: “, “”)
; Just in case – remove all carriage returns (`r)
StringReplace, full_path, full_path, `r, , all
IfInString full_path,
{
Run, cmd /K cd /D “%full_path%”
}
else
{
Run, cmd /K cd /D “C: ”
}
}
把上面代碼存為UTF-8編碼格式(因?yàn)橛兄形?的ahk格式,用Autohotkey打開(kāi),然后按win鍵+C就可以在當(dāng)前目錄下打開(kāi)cmd命令行了.
這段小代碼肯能有兩個(gè)你需要修改的地方
1. #c:: 中的#代表win鍵, 這個(gè)代碼中使用的是win鍵+C, C可以改成你需要的其它鍵
2. 如果你的系統(tǒng)是英文的,你需要把”地址: ” 改為 “^Address: “
全程面授,不高薪都難
申請(qǐng)成功后,我們將在24小時(shí)內(nèi)與您聯(lián)系
招生熱線: 4008-0731-86 / 0731-82186801
學(xué)校地址: 長(zhǎng)沙市天心區(qū)團(tuán)結(jié)路6號(hào)
Copyright © 2006 | 湖南大計(jì)信息科技有限公司 版權(quán)所有
湘ICP備14017520號(hào)-3