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


当前回答

这个答案适用于windows 10。

在文件夹中创建一个命令提示符快捷方式,然后右键单击该快捷方式

and

其他回答

我看到有很多答案,有些相当复杂:),看到它们很奇怪。你只需要打开任何windows文件夹窗口,导航到你想要的文件夹,并专注于地址栏,输入“cmd”并按enter,你将会直接显示新的命令提示符窗口,其中包含我们已经在windows文件夹窗口中导航的文件夹路径或位置。 如果你想看清楚这些步骤的图像,你可以检查

如何直接打开特定文件夹中的命令提示符

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

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

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

更新:这是内置在Windows现在。请看这个答案。

XP的动力玩具是一个不错的选择,但我想我要发布另一个,以防你想“滚你自己的”。创建一个文本文件,命名为任何。Reg,粘贴下面的代码,保存它,然后双击它将其添加到注册表中(或者只要手动将信息添加到注册表中,如果您了解这个. Reg文件中发生了什么)。

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\Command_Prompt_Here...]
@="Command Prompt Here..."

[HKEY_CLASSES_ROOT\Folder\shell\Command_Prompt_Here...\command]
@="cmd.exe \"%1\""

更新:在windows更新后,Win10删除了cmd-here功能。要重新激活它,你必须使用:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@="@shell32.dll,-8506"
"Extended"=""
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8

[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="cmd.exe /s /k pushd \"%V\""

ShowBasedOnVelocityId为必选项

另一个简单的解决方案是安装Windows终端。

然后,当你右键单击一个文件夹时,你会自动出现“在Windows终端中打开”:

如果您使用的是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来获得相同的功能。