<form id="hz9zz"></form>
  • <form id="hz9zz"></form>

      <nobr id="hz9zz"></nobr>

      <form id="hz9zz"></form>

    1. 首頁 > 電腦資訊 > 電腦知識

      Windows下更高效的打開你的命令行

      作者:佚名   來源:本站   時間:2018-07-11  點擊:117次

              此文僅限于對經常需要打開命令行并且感到正常打開命令行方式很浪費時間的人.

        正常情況下我門需要打開CMD, 然后再CD到自己需要的目錄, 這對偶爾用用的人倒沒什么. 但是經常需要這么些操作就感到浪費了大把時間. 現在提供兩種方式讓你像在linux中那樣更高效的在當前目錄打開命令行.

        方式一:

        在當前目錄按Shift+鼠標右鍵, 你就可以看到類似的在此處打開命令行的選項了, 如果你想去掉shift,直接按鼠標右鍵就有此選項, 那么你需要用簡單的修改下你的注冊表,

        去注冊表位置HKEY_CLASSES_ROOT\Directory\shell\cmd 下面將Extended鍵值刪掉, 如果你還希望驅動器和桌面也能這樣, 將HKEY_CLASSES_ROOT\Driver\shell\cmd和

        HKEY_CLASSES_ROOT\Directory\Background\shell\cmd 下的Extended鍵值去掉即可.

        方式二:

        用快捷鍵,當然會用到人見人愛的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編碼格式(因為有中文)的ahk格式,用Autohotkey打開,然后按win鍵+C就可以在當前目錄下打開cmd命令行了.

        這段小代碼肯能有兩個你需要修改的地方

        1. #c:: 中的#代表win鍵, 這個代碼中使用的是win鍵+C, C可以改成你需要的其它鍵

        2. 如果你的系統是英文的,你需要把”地址: ” 改為 “^Address: “

      推薦游戲

      換一換
      日韩精品一区二区三区高清