| 此文仅限于对经常需要打开命令行并且感到正常打开命令行方式很浪费时间的人。 / w; p; B' @4 h; x  正常情况下我门需要打开CMD, 然后再CD到自己需要的目录, 这对偶尔用用的人倒没什么。 但是经常需要这么些操作就感到浪费了大把时间。 现在提供两种方式让你像在linux中那样更高效的在当前目录打开命令行。8 l2 e, N% x2 l& A, {! p
 方式一:
 ! k9 `; ]2 U3 ^  在当前目录按Shift+鼠标右键, 你就可以看到类似的在此处打开命令行的选项了, 如果你想去掉shift,直接按鼠标右键就有此选项, 那么你需要用简单的修win7系统改下你的注册表,
 - F8 r7 ]" C) b2 _  去注册表位置HKEY_CLASSES_ROOT\Directory\shell\cmd 下面将Extended键值删掉, 如果你还希望驱动器和桌面也能这样, 将HKEY_CLASSES_ROOT\Driver\shell\cmd和( M# e2 F" E0 V' X" W
 HKEY_CLASSES_ROOT\Directory\Background\shell\cmd 下的Extended键值去掉即可。3 ^$ M! U5 }  U- i9 K; e
 方式二:
 ( S) k- D6 J1 @- q/ b+ `( t  用快捷键,当然会用到人见人爱的Autohotkey. 其Auothotkey代码如下:7 ]5 R& B: M. k$ `" \" ^+ a" R  k4 _
 SetTitleMatchMode RegEx
 2 F& d* n& C7 n/ B  return+ m3 X, r+ a7 k4 ?7 w" l9 W, ~$ \
 ; Stuff to do when Windows Explorer is open
 6 W! B6 I# K. K1 n( M  ;
 8 W2 w0 V6 R! e% Z- J; |  #IfWinActive ahk_class ExploreWClass|CabinetWClass
 - z. }2 M* a' _/ Y  ; open ‘cmd’ in the current directory
 ! w) p- h- q4 r% {1 _% x1 D  ;4 ]7 p! E& ]; A2 W! l
 #c::$ f8 R6 ^7 r) V- v
 OpenCmdInCurrent()
 - m) q3 B4 U2 G  l) N% g  return
 $ F! N" U) p. C  #IfWinActive
 / P% `/ i. r' w. t6 Y5 o/ A. n  ; Opens the command shell ‘cmd’ in the directory browsed in Explorer., G; h8 M) K8 Q( r, [/ d
 ; Note: expecting to be run when the active window is Explorer.1 q" q& V8 {; B
 ;
 0 b: r+ d5 S* [! j; N4 ]% V' S  OpenCmdInCurrent()( A, y7 z! I7 a. p/ @+ w; S- P, {
 {
 + {+ u: Q+ ]7 B6 B  ; This is required to get the full path of the file from the address bar
 & k: o, l0 T# `  U  WinGetText, full_path, A- Q* A9 y9 _: W2 y
 ; Split on newline (`n)
 * w3 D6 L6 ^, p3 @' D! h' ?7 I  StringSplit, word_array, full_path, `n
 5 M, }9 D3 t/ I  N/ y  ; Take the first element from the array3 l. }1 J* L2 R& ]+ g* w5 a! X5 x1 X
 full_path = %word_array1%
 & L% h6 M+ x: ?: a  ; strip to bare address
 + h  r# J5 M# x0 @% k  full_path := RegExReplace(full_path, “地址: “, “”)
 + x9 u4 U5 x6 v" K" q# K& t% u  ; Just in case – remove all carriage returns (`r)
 * y5 r/ p+ c% n  S  StringReplace, full_path, full_path, `r, , all" M7 [: e; V9 G/ t
 IfInString full_path, \, k2 Y. F5 h, g0 P$ {+ @
 {
 1 |4 l% [) I# S  Run, cmd /K cd /D “%full_path%”' J, T* ?, r5 p3 _6 s, k( ^6 K
 }
 ; C5 Y' q3 `/ q  else
 ( R5 X1 Z( z4 @! s3 R0 f9 d3 G  {
 6 I0 N- g6 H# M+ |  Run, cmd /K cd /D “C:\ ”
 6 \  V" d' b% P4 H. i0 G3 L  }
 + o' R" d5 Q1 b, _  }
 % R& v4 p! ?4 ^9 a: `0 A  把上面代码存为UTF-8编码格式(因为有中文)的ahk格式xp系统之家,用Autohotkey打开,然后按win键+C就可以在当前目录下打开cmd命令行了。7 O% n+ z, d% p- h7 R2 Q0 U
 这段小代码肯能有两个你需要修改的地方( s, \7 y3 u. V$ C4 f1 J
 1. #c:: 中的#代表win键, 这个代码中使用的是win键+C, C可以改成你需要的其它键
 2 u1 o* g* `" r8 n  2. 如果你的系统是英文的,你需要把”地址: ” 改为 “^Address: “
 6 T9 B) k! p$ Q2 D& X3 D. }7 f
 |