Windows 资源管理器“此处的命令提示符”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/378319/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:52:40  来源:igfitidea点击:

Windows Explorer "Command Prompt Here"

windowscommand-linewindows-explorer

提问by recursive

I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.

我经常发现自己在 Windows 中打开了一个文件夹,希望使用相同的工作目录打开命令提示符。

I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside the folder if you are already there. I know you can navigate to the parent directory, and use it from there, but if the parent has thousands of directories in it, this is not so convenient. I have tried some home-brewed batch files associated with folder actions in explorer, but those suffer from similar problems.

我知道 Power Toys 的“命令提示符”,但它只能作为文件夹上的上下文菜单项使用,如果您已经在文件夹内,则不能使用它。我知道您可以导航到父目录,并从那里使用它,但是如果父目录中有数千个目录,这就不那么方便了。我已经尝试了一些与资源管理器中文件夹操作相关的自制批处理文件,但这些文件遇到了类似的问题。

So, what is the quickest way to open a command prompt with a working directory of the current windows explorer folder?

那么,使用当前 Windows 资源管理器文件夹的工作目录打开命令提示符的最快方法是什么?

My current approach: (horrible)

我目前的做法:(可怕)

  • Alt- D, Ctrl- C(copy path)
  • Win- R, "cmd", Enter(start command prompt)
  • "cd", Space(start a change directory command)
  • Alt- Space, e, p(paste directory)
  • Enter(execute change directory)
  • Alt- D, Ctrl-C(复制路径)
  • Win- R, "cmd",Enter(启动命令提示符)
  • "cd",Space(启动更改目录命令)
  • Alt- Space, e,p(粘贴目录)
  • Enter(执行更改目录)

I know there is something better! What is it?

我知道有更好的东西!它是什么?

回答by clawr

Hold Shiftwhile Right-Clickinga blank space in the desired folder to bring up a more verbose context menu. One of the options is Open Command Window Here. This works in Windows Vista, 7, 8, and 10. Since Windows 10 Creators Update, the option has been replaced with Open PowerShell Here. However, there are ways to enable Open Command Window Hereagain.

按住Shift 的同时右键单击所需文件夹中的空白区域以显示更详细的上下文菜单。选项之一是Open Command Window Here。这适用于 Windows Vista、7、8 和 10。自 Windows 10 创意者更新以来,该选项已替换为Open PowerShell Here. 但是,有一些方法可以Open Command Window Here再次启用.

回答by dr. evil

Just type "cmd" to location bar, that's it. It will start a new command prompt in current path.

只需在位置栏输入“cmd”,就可以了。它将在当前路径中启动一个新的命令提示符。

This solution was confirmed to work in Windows XP, Vista, 7, 8 and 10 (including Creators Update).

此解决方案已确认适用于 Windows XP、Vista、7、8 和 10(包括创意者更新)。

Keystrokes to move the focus to the location bar:

将焦点移动到位置栏的按键:

  • AltDin English (pointed out by Tim Stewart in the comments)
  • AltEin German
  • AltD英文(由 Tim Stewart 在评论中指出)
  • AltE在德国

回答by dimitrisk

Inside your current folder, simply press Shift+Alt+F--then--> Enter.

在当前文件夹中,只需按Shift+ Alt+ F--然后--> Enter

The prompt will appear with your current folder's path set.

提示将与您当前文件夹的路径设置一起出现。

Note: That works only in Windows 7 / Vista. What it does is that drops the "File" menu down for you, because the "Shift" key is pressed the option "Open command window here" is enabled and focused as the first available option of "File" menu. Pressing enter starts the focused option therefor the command window.

注意:这仅适用于 Windows 7 / Vista。它的作用是为您放下“文件”菜单,因为按下“Shift”键,选项“在此处打开命令窗口”被启用并聚焦为“文件”菜单的第一个可用选项。按回车键启动命令窗口的焦点选项。

Edit:

编辑:

In case you are in a folder and you already selected some of its contents (file/folder) this wont work. In that case Click on the empty area inside the folder to deselect any previously selected files and repeat.

如果您在一个文件夹中并且您已经选择了它的一些内容(文件/文件夹),这将不起作用。在这种情况下,单击文件夹内的空白区域以取消选择任何先前选择的文件并重复。

Edit2:

编辑2:

Another way you can open terminal in current directory is to type cmdon file browser navigation bar where the path of current folder is written.

在当前目录中打开终端的另一种方法是cmd在文件浏览器导航栏上输入当前文件夹的路径。

In order to focus with your keyboard on the navigation bar Ctrl+L. Then you can type cmdand hit Enter

为了用键盘将注意力集中在导航栏上Ctrl+ L. 然后你可以输入cmd并点击Enter

回答by Rob Kennedy

Right-click the title-bar icon of the Explorer window.You'll get the current folder's context menu, where you'll find the "command window here" item.

右键单击资源管理器窗口的标题栏图标。您将获得当前文件夹的上下文菜单,您将在其中找到“此处的命令窗口”项。

(Note that to see that menu item, you need to have the corresponding "power toy"installed, or you can create the right registry keysyourself to add that item to folders' context menus.)

(请注意,要查看该菜单项,您需要安装相应的“强力玩具”,或者您可以自己创建正确的注册表项以将该项目添加到文件夹的上下文菜单中。)

回答by Bura Chuhadar

As a very quick solution I can give you this. I tested this on Windows 8.1

作为一个非常快速的解决方案,我可以给你这个。我在 Windows 8.1 上测试过

1- Find File and Right Click on Command Prompt on File Explorer and then add command prompt to your Quick Access Toolbar:

1- 查找文件并右键单击文件资源管理器上的命令提示符,然后将命令提示符添加到您的快速访问工具栏:

Instruction 1

说明 1

2- After adding it you can access the folder from here:

2- 添加后,您可以从这里访问该文件夹:

Instruction 2

说明 2

That will open a command prompt in there for you.

这将为您打开一个命令提示符。

回答by Raymond Gauthier

On vista and windows 7:

在 Vista 和 Windows 7 上:

  • Alt+d-> it will put focus on the address bar of the explorer window
  • and then, type the name of any program you would launch using WIN+r
  • hit Enter
  • Alt+d-> 它将焦点放在资源管理器窗口的地址栏上
  • 然后,键入您将使用 WIN+r 启动的任何程序的名称
  • 进入

The program will start with its current directory set to that of the explorer instance. e.g.:python, ghci, powershell, cmd, etc...

该程序将以其当前目录设置为资源管理器实例的目录开始。例如:python、ghci、powershell、cmd 等...

回答by Shirish

For Windows vista and Windows 7 ,to open the command prompt 1) go to folder you want to work

对于 Windows vista 和 Windows 7,要打开命令提示符 1) 转到您要工作的文件夹

2)In address bar type- cmd

2)在地址栏中输入- cmd

press enter

按回车

it will open the command prompt for that location

它将打开该位置的命令提示符

回答by ctype.h

You can edit the registry to add the Command Prompt item to the context menu. Here are a couple of .reg files that I use.

您可以编辑注册表以将命令提示符项添加到上下文菜单中。这是我使用的几个 .reg 文件。

Cmdhere.reg - for WinNT/2000/XP/Vista/7:

Cmdhere.reg - 适用于 WinNT/2000/XP/Vista/7:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
@="Command Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
@="cmd.exe /k cd %1"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew]
@="Command Prompt"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew\Command]
@="cmd.exe /k cd %1"

Doshere.reg - for Win9x:

Doshere.reg - 适用于 Win9x:

REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
@="MS-DOS Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
@="command.com /k cd %1"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew]
@="MS-DOS Prompt"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew\Command]
@="command.com /k cd %1"

Copy this into an empty text file and change the extension to .reg. Double-clicking on this in Windows Explorer will add these key to the registry.

将其复制到一个空文本文件中并将扩展名更改为 .reg。在 Windows 资源管理器中双击它会将这些键添加到注册表中。

回答by palehorse

I use StExBar, a Windows Explorer extension that gives you a command prompt button in explorer along with some other cool features (copy path, copy file name & more).

我使用 StExBar,这是一个 Windows 资源管理器扩展,它为您提供资源管理器中的命令提示按钮以及其他一些很酷的功能(复制路径、复制文件名等)。

http://tools.tortoisesvn.net/StExBar

http://tools.tortoisesvn.net/StExBar

EDIT: I just found out (been using it for more than a year and did not know this) that Ctrl+M will do it with StExBar. How's that for fast!

编辑:我刚刚发现(已经使用了一年多,但不知道这一点)Ctrl+M 可以用 StExBar 来完成。怎么这么快!

回答by Sam Meldrum

Almost the same as yours:

和你的差不多:

  • Alt+d, Ctrl+c
  • Win+r
  • cmd /K cd, Ctrl+v, ENTER
  • Alt+d, Ctrl+c
  • 赢+r
  • cmd /K cd, Ctrl+v, ENTER