我怎样才能在一个特定的位置打开一个cmd窗口,而不必一直导航到我想要的目录?


当前回答

试试微软的这个“强力玩具”吧:

此处打开命令窗口 这个PowerToy增加了一个“打开命令” “窗口此处”上下文菜单选项打开 文件系统文件夹,给你一个 快速打开命令窗口的方法 (cmd.exe)指向所选的 文件夹中。

编辑:此软件将不能工作在任何版本的Windows除了Windows XP。

其他回答

你还可以这样做:

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@="command prompt here"
[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="cmd.exe /c start \"%1\" cmd.exe /k cd /d %1"
[HKEY_CLASSES_ROOT\Drive\shell\cmd]
@="command prompt here"
[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]
@="cmd.exe /c start \"%1\" cmd.exe /k cd /d %1"

更新:Win10你需要ShowBasedOnVelocityId -见上面的答案。

尽管在Windows 10下的HKCR\Directory\shell有几个答案(不工作),但以下对我来说是有效的:

SetOpenCmdHere.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\cmd]
@="Open CMD here..."

[HKEY_CLASSES_ROOT\Folder\shell\cmd\command]
@="C:\\Windows\\system32\\cmd.exe /k pushd \"%1\""

如果您使用的是Windows Vista或更高版本,请按住Shift键右键单击资源管理器中的文件夹图标,然后单击“在此打开命令窗口”或“在此打开PowerShell窗口”上下文菜单选项。

如果你已经在你想要的文件夹中,你可以执行以下操作之一:

[only Win8+] Click the Explorer Ribbon's File button, then click on "Open command window here" or "Open PowerShell window here". Shift-right-click on the background of the Explorer window, then click on "Open command window here" or "Open PowerShell window here". (recommended by Kate in the comments) [only Vista or Win7] Hold down Shift when opening the Explorer File menu, then click on "Open command window here". If you can't see the menu bar, open the File menu by pressing Alt-Shift-F - Alt-F to open the File menu, plus Shift.

对于Windows XP,使用dF提到的PowerToy来获得相同的功能。

在Windows Vista、Windows 7和Windows 10上,只需按住Shift键并右键单击文件夹即可。

上下文菜单将包含一个标题为“此处打开命令窗口”的条目。

更新:在浏览器地址栏中输入“cmd”并回车

更新2:在windows 10中,进入文件菜单并选择“打开windows PowerShell”。有一个以管理员身份运行的选项。

更新3:您还可以通过进入文件菜单添加一个快速访问快捷方式,右键单击“打开windows powershell”并选择“添加到快速访问工具栏”,然后只需单击即可立即访问powershell

在Windows资源管理器- shift +鼠标右键点击上面的文件夹“打开命令窗口这里”选项显示在菜单中。或在您的Windows版本的语言。