| 此文仅限于对经常需要打开命令行并且感到正常打开命令行方式很浪费时间的人。6 e* Y! d. @: H. V( Q" E) _ 正常情况下我门需要打开CMD, 然后再CD到自己需要的目录, 这对偶尔用用的人倒没什么。 但是经常需要这么些操作就感到浪费了大把时间。 现在提供两种方式让你像在linux中那样更高效的在当前目录打开命令行。: J1 Q( L) i! h  [5 b/ ~
 方式一:
 ! f! N+ }: T  q9 \& F$ ~  在当前目录按Shift+鼠标右键, 你就可以看到类似的在此处打开命令行的选项了, 如果你想去掉shift,直接按鼠标右键就有此选项, 那么你需要用简单的修win7系统改下你的注册表,
 0 ]0 F& J2 P! T0 W0 z, f  a& c' c  去注册表位置HKEY_CLASSES_ROOT\Directory\shell\cmd 下面将Extended键值删掉, 如果你还希望驱动器和桌面也能这样, 将HKEY_CLASSES_ROOT\Driver\shell\cmd和' Z: m+ w' H4 G7 p
 HKEY_CLASSES_ROOT\Directory\Background\shell\cmd 下的Extended键值去掉即可。
 o) _' w2 E, T# D+ g/ _/ C  方式二:
 1 \* _  j9 l* L( ]3 Q! N$ D  用快捷键,当然会用到人见人爱的Autohotkey. 其Auothotkey代码如下:
 $ V$ ]+ T9 f& l# V! }7 G( J  SetTitleMatchMode RegEx5 e2 ]& j7 ?% X' j  |" M
 return6 x0 O9 `. d. i8 g5 i
 ; Stuff to do when Windows Explorer is open& K* a7 ^: T, R  c0 ?, Z
 ;7 A! v; k7 y2 Q* w- [/ H
 #IfWinActive ahk_class ExploreWClass|CabinetWClass
 ' E  R  t, `! `7 Y4 H9 u& d  ; open ‘cmd’ in the current directory
 # S/ M( b; Q; s  ;, V; S5 Z7 [+ n: `: S- W) U& f
 #c::
 : ?/ c) V' X9 ?  OpenCmdInCurrent()! v- {0 S) B. e' u3 G
 return4 F; m" W* }! j3 X% {8 Q2 T
 #IfWinActive
 Y8 [% ]) t+ u+ [8 _$ x  ; Opens the command shell ‘cmd’ in the directory browsed in Explorer.- v, e0 k3 B/ M  P8 R+ E( C
 ; Note: expecting to be run when the active window is Explorer.( x4 o5 W0 N" n. K1 u
 ;
 + t0 d" q$ g8 j/ p9 n  F  OpenCmdInCurrent()
 ; F6 S& k0 G0 i' j  {! Q& a' ^; p6 K' O
 ; This is required to get the full path of the file from the address bar, X7 P( C1 C4 M9 O& _' l- m
 WinGetText, full_path, A4 B1 y; T/ H) K2 {- z8 t: W  b
 ; Split on newline (`n), t  x/ f2 F7 H+ l. h2 j! J
 StringSplit, word_array, full_path, `n
 ' r0 f/ A4 s1 l$ y% h8 o+ q  ; Take the first element from the array$ H7 k1 s6 k7 U% G( w
 full_path = %word_array1%, n4 P3 R3 `/ T& K% |5 ]. |
 ; strip to bare address. [( o) U  O6 m+ z0 S
 full_path := RegExReplace(full_path, “地址: “, “”)5 ^7 `# I. e( c* L* D; f% B
 ; Just in case – remove all carriage returns (`r)6 _2 j* _$ @& T/ |* _4 x8 G
 StringReplace, full_path, full_path, `r, , all
 / ^% S6 G: v( t( b; E  IfInString full_path, \' i) y: N- }( v; A* ~( p2 l
 {4 d; `8 Q$ F. R8 o3 c
 Run, cmd /K cd /D “%full_path%”
 ; w6 T9 {) t* Y: X  }
 0 F' {2 D) H4 i2 h- u2 V  else
 v: g+ f- ?& l& P/ }5 n4 s  {
 : {6 A/ x# f% X* e* a; y% k2 K9 v  Run, cmd /K cd /D “C:\ ”
 ) X6 i  E2 b( E; f8 u  }! L1 \3 T, Q; n3 A8 c5 ]; n
 }, o" n% Q* x8 ^1 ]
 把上面代码存为UTF-8编码格式(因为有中文)的ahk格式xp系统之家,用Autohotkey打开,然后按win键+C就可以在当前目录下打开cmd命令行了。8 g$ Q/ q! c- H0 M) {6 Z( @5 v: V
 这段小代码肯能有两个你需要修改的地方7 l: W% l6 V7 r! ^8 |* u+ i
 1. #c:: 中的#代表win键, 这个代码中使用的是win键+C, C可以改成你需要的其它键, a* M( G0 d: L( x5 p
 2. 如果你的系统是英文的,你需要把”地址: ” 改为 “^Address: “
 1 W! ~  g  z# ?" b# I
 |