如何使用键盘快捷键在当前文件夹中打开命令提示符?

Gem*_*ili 126 windows keyboard-shortcuts autohotkey command-line

如何在 Windows 7 中使用键盘快捷键在当前文件夹中打开命令提示符?
有什么方法可以实现吗?
我认为 Autohotkey 可以做到这一点,但不知道如何。

Ash*_*ppa 148

Alt+ D,键入cmd并按Enter。有关更多详细信息,请参阅此处的博客文章。

  • `Ctrl+L` 是另一种选择。 (5认同)
  • 注意 - 您无需按 Alt+d 即可使用。我在 Windows 7 中所要做的就是在 Windows 资源管理器的路径中键入 cmd 并按 Enter。Alt+d 只是自动选择当前路径。 (2认同)

Lef*_*ium 128

使用此键盘快捷键:Shift+ Menu, W,Enter

  1. Shift+ Menu(或者,Shift+ F10),(在当前文件夹中打开扩展的右键菜单)

  2. W (选择“在此处打开命令窗口”),

  3. Enter(激活选择;需要,因为“新建”也可以用 选择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

信用:Eli Bendersky

  • 啊,移位菜单很好。 (3认同)
  • 对我不起作用。 (2认同)

aki*_*ira 42

在 windows7 中执行类似操作的本机方法是按住shift鼠标右键到要“命令提示符”到的文件夹上,然后上下文菜单中将出现一个新菜单项,为您提供:“在此处打开命令提示符”。

替代文字

如果你想要纯键盘操作,那么你必须这样做:

  • 打开 regedit
  • 转到HKEY_CLASSES_ROOT\Directory\shell\cmd并将Extended密钥重命名为Extended_save
  • 转到HKEY_CLASSES_ROOT\Drive\shell\cmd并重命名Extended key toExtended_save`

这会将“在此处打开命令窗口”条目永久添加到上下文菜单中。您可以按以下键触发此条目:

  • alt
  • 放手,上下文菜单打开
  • 按“在此处打开命令窗口”条目的“下划线”字符或使用光标键向下并点击 enter

菜单项的名称根据操作系统的语言进行标记。

另一种方法是这样做:

  • 通过资源管理器在命令提示符中打开所需的文件夹
  • f4
  • ctrla
  • ctrlc
  • winr
  • 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 次

最近记录:

4 年,10 月 前