| 此文仅限于对经常需要打开命令行并且感到正常打开命令行方式很浪费时间的人。2 s0 _3 x; ]6 ?5 z! L 正常情况下我门需要打开CMD, 然后再CD到自己需要的目录, 这对偶尔用用的人倒没什么。 但是经常需要这么些操作就感到浪费了大把时间。 现在提供两种方式让你像在linux中那样更高效的在当前目录打开命令行。
 9 C" r- K/ o8 \; {+ K4 ^4 S+ S5 o  方式一:, ^' T# L3 c' `
 在当前目录按Shift+鼠标右键, 你就可以看到类似的在此处打开命令行的选项了, 如果你想去掉shift,直接按鼠标右键就有此选项, 那么你需要用简单的修win7系统改下你的注册表,- v4 x5 W6 g7 N5 E: q, p, G
 去注册表位置HKEY_CLASSES_ROOT\Directory\shell\cmd 下面将Extended键值删掉, 如果你还希望驱动器和桌面也能这样, 将HKEY_CLASSES_ROOT\Driver\shell\cmd和
 " G/ o! R5 x* {2 F  HKEY_CLASSES_ROOT\Directory\Background\shell\cmd 下的Extended键值去掉即可。
 : G' m. u2 C# p* p  方式二:
 . Z+ L( j; f! m2 _3 t, O* o  用快捷键,当然会用到人见人爱的Autohotkey. 其Auothotkey代码如下:
 ' S0 c! k: p1 a  SetTitleMatchMode RegEx
 & U8 I8 a0 ^  Z# S3 u; o4 v  return0 {4 e& ~, |% I' `: @
 ; Stuff to do when Windows Explorer is open
 1 @/ |) v( d& z( U6 S  ;: L$ v& S) O5 b3 e- H
 #IfWinActive ahk_class ExploreWClass|CabinetWClass  c9 N8 q* q! I4 h  X+ I
 ; open ‘cmd’ in the current directory
 - r' ?, \5 `9 g9 c  ;6 Y, _& }4 y3 k5 g$ m
 #c::
 & o' ]4 j1 ^: p) b4 G3 u7 K  OpenCmdInCurrent()* u5 A# b! A  I& N3 b
 return
 9 y! i) |2 e/ ]% d3 o  #IfWinActive0 o' @+ n9 i- M1 k6 E' p4 Y
 ; Opens the command shell ‘cmd’ in the directory browsed in Explorer.
 ) N6 i5 q0 E4 S! I- R( w! @. S6 D  ; Note: expecting to be run when the active window is Explorer.1 g6 I8 T; N$ u+ g# g' _: @
 ;
 - T0 K2 P% J4 j- N( L  OpenCmdInCurrent()
 2 K# B+ a$ Z- Z' l  {
 1 S& P' ^5 T( ^5 Z! t+ Z7 \* K  ; This is required to get the full path of the file from the address bar
 : v0 o) Q$ T& y; v7 M4 D, n" Y7 }/ i6 K  WinGetText, full_path, A
 8 r( Y" u1 v1 ]4 T  s5 V0 |& j+ D  ; Split on newline (`n)
 $ _. X- K- J6 q3 o% Q  StringSplit, word_array, full_path, `n$ }8 @6 G" I% a7 l" H/ z
 ; Take the first element from the array/ }% V( K' f) i# m
 full_path = %word_array1%
 / _) b; H  d4 h6 M  ; strip to bare address
 3 E' c: Q# z% r# U  full_path := RegExReplace(full_path, “地址: “, “”)
 , j% F' |( d' N7 s- M  ; Just in case – remove all carriage returns (`r)
 7 U2 y" ~# z2 k# t+ G5 L/ j* }  StringReplace, full_path, full_path, `r, , all3 k* U1 d, R3 P8 H5 q
 IfInString full_path, \
 : i/ }' e+ W! r/ i5 D! M  {' m' B; N5 [6 u5 Q3 Q) u4 w, a
 Run, cmd /K cd /D “%full_path%”) m2 p$ p1 w1 r" Y* V
 }
 ; p# s, Q- j( N; h: b7 z% j- n  else" x) `. c1 ~9 R9 D5 a) x; f
 {6 m9 C4 V0 U3 K! n( U5 \, g
 Run, cmd /K cd /D “C:\ ”4 g' n, p- ?$ p* |$ r$ |
 }
 ' P4 k2 m5 L6 f/ Q" v- g# ?5 \1 {( z  }
 7 f2 p3 _( b2 L; T# G& g  把上面代码存为UTF-8编码格式(因为有中文)的ahk格式xp系统之家,用Autohotkey打开,然后按win键+C就可以在当前目录下打开cmd命令行了。7 |( v/ S; m* p( U. _# ~
 这段小代码肯能有两个你需要修改的地方
 / Q( \2 y/ m! l% M9 F+ L" [  1. #c:: 中的#代表win键, 这个代码中使用的是win键+C, C可以改成你需要的其它键& g8 m; i# q$ L  \/ l; m- m
 2. 如果你的系统是英文的,你需要把”地址: ” 改为 “^Address: “
 6 p9 \( j' q* L* I; v5 Q% w
 |