Gem*_*ili 126 windows keyboard-shortcuts autohotkey command-line
如何在 Windows 7 中使用键盘快捷键在当前文件夹中打开命令提示符?
有什么方法可以实现吗?
我认为 Autohotkey 可以做到这一点,但不知道如何。
Lef*_*ium 128
使用此键盘快捷键:Shift+ Menu, W,Enter
Shift+ Menu(或者,Shift+ F10),(在当前文件夹中打开扩展的右键菜单)
W (选择“在此处打开命令窗口”),
该Menu键是指由微软推出,通常在右边右侧的特殊键Win键。
此快捷方式在 Windows (7) 的默认安装中可用,无需任何 3rd 方软件。
AHK 方式。你只需要按Win+C(或任何你想定义它的东西。):
SetTitleMatchMode RegEx
return
; Stuff to do when Windows Explorer is open
;
#IfWinActive ahk_class ExploreWClass|CabinetWClass
; create new text file
;
#t::Send !fwt
; 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
; Find and take the element from the array that contains address
Loop, %word_array0%
{
IfInString, word_array%A_Index%, Address
{
full_path := word_array%A_Index%
break
}
}
; strip to bare address
full_path := RegExReplace(full_path, "^Address: ", "")
; 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:\ "
}
}
Run Code Online (Sandbox Code Playgroud)
作为奖励,上面也该脚本创建与此快捷方式的新文本文件:Win+T
aki*_*ira 42
在 windows7 中执行类似操作的本机方法是按住shift鼠标右键到要“命令提示符”到的文件夹上,然后上下文菜单中将出现一个新菜单项,为您提供:“在此处打开命令提示符”。

如果你想要纯键盘操作,那么你必须这样做:
regeditHKEY_CLASSES_ROOT\Directory\shell\cmd并将Extended密钥重命名为Extended_saveHKEY_CLASSES_ROOT\Drive\shell\cmd并重命名Extended key toExtended_save`这会将“在此处打开命令窗口”条目永久添加到上下文菜单中。您可以按以下键触发此条目:
菜单项的名称根据操作系统的语言进行标记。
另一种方法是这样做:
cmd /k cd ctrlventer它从资源管理器的地址栏中获取当前路径并执行cmd /k cd PATH. 使用自动热键你可以做同样的事情,但我不知道自动热键。
Mit*_*ril 10
从how-to-open-cmd-in-current-folder-by-shortcut-windows-10
如果您使用的是 Windows 8/10,则有一种更快更原始的方法:
Alt+ F,P
只需三个键并键入两次,无需其他程序的帮助。
| 归档时间: |
|
| 查看次数: |
274041 次 |
| 最近记录: |