59

This can be done easily in Ubuntu, just right click and open Terminal. It is very inconvenient to open cmd.exe then cd to the folder.

So, how do I open a terminal quickly from a file explorer at a folder?

1
  • @grwawity Not a duplicate: the linked question restrict to the the Context Menu, while this one is open to any other method. E.g. another solution is to type "cmd" to location bar. I'd like to add it as answer but cannot because this question is marked as duplicate… Jul 14, 2015 at 17:18

7 Answers 7

115
  1. Hold Shift + Right Click the folder you want it opened on, and click "open command window here". That should do the trick!

OR

  1. You can also type cmd into the Windows File Explorer address bar (use Ctrl+L to focus the address bar) and press Enter to open the shell.
6
  • 3
    #2 is a neat trick, it’s a shame it doesn’t work (in Windows 10) for UNC paths.
    – Richard
    Aug 25, 2020 at 10:05
  • 2
    #1 not working for me on Win 10. I get PowerShell.
    – johny why
    Sep 20, 2020 at 17:55
  • 1
    @johnywhy you're right, it's PowerShell on Win 10. This answer on superuser seems to be the best way to restore the "open command window" via some registry edits - it also has an alternative enhancement to keep both with a new registry file: superuser.com/a/1202148
    – sofly
    Oct 19, 2020 at 21:11
  • 2
    @sofly Maybe you can just go into Windows 10 Settings > Taskbar, and turn off "Replace command prompt with Windows PowerShell"
    – johny why
    Oct 20, 2020 at 22:17
  • 3
    Number 1. is good to open Powershell, number 2. is good for classic command line.
    – Beauty
    May 5, 2021 at 20:11
9

You can type cmd in Windows Explorer's location bar (which you can edit with the keyboard shortcut Alt+D); it will open a terminal upon pressing Enter.


Personally I use a voice command in Dragon NaturallySpeaking that takes care of it:

Dragon NaturallySpeaking commands editor

Code:

Sub Main
    SendKeys "%d"
    Wait(0.1)
    SendKeys "cmd"
    Wait(0.1)
    SendKeys "{ENTER}"
End Sub
2
  • Is CTRL-D the correct combination to edit the address bar in Explorer, or is it ALT-D? May 18, 2018 at 15:19
  • @music2myear ALT-D May 18, 2018 at 20:45
5

Press Ctrl+L. This will allow you to edit the location bar address of the file explorer. Type cmd and press Enter. This will open command prompt in current folder.

2
  • 2
    Probably need to clarify this needs done from Windows/File Explorer, which versions of Windows it works with, and confirm none of the existing answers contain this already. Sep 3, 2017 at 13:47
  • I think this is the best answer about open terminal for current folder path
    – JackWu
    Sep 10, 2018 at 3:50
1

You can use Andrew Richards' Enhancing the “Open Command Prompt here” Context Menu experience tweak

run cmd elevated

run powershell elevated

Just import the below *.reg file (or copy from the MSDN blog above)

Windows Registry Editor Version 5.00

; Command Prompt

[HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd]
"MUIVerb"="Command Prompts"
"Icon"="cmd.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuCmd"

[HKEY_CLASSES_ROOT\Directory\background\shell\01MenuCmd]
"MUIVerb"="Command Prompts"
"Icon"="cmd.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuCmd"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open]
"MUIVerb"="Command Prompt"
"Icon"="cmd.exe"

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

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas]
"MUIVerb"="Command Prompt Elevated"
"Icon"="cmd.exe"
"HasLUAShield"=""

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


; PowerShell

[HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell]
"MUIVerb"="PowerShell Prompts"
"Icon"="powershell.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuPowerShell"

[HKEY_CLASSES_ROOT\Directory\background\shell\02MenuPowerShell]
"MUIVerb"="PowerShell Prompts"
"Icon"="powershell.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuPowerShell"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open]
"MUIVerb"="PowerShell"
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open\command]
@="powershell.exe -noexit -command Set-Location '%V'"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas]
"MUIVerb"="PowerShell Elevated"
"Icon"="powershell.exe"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas\command]
@="powershell.exe -noexit -command Set-Location '%V'"


; Ensure OS Entries are on the Extended Menu (Shift-Right Click)

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\background\shell\cmd]
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\shell\Powershell]
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\background\shell\Powershell]
"Extended"=""
0

As I don't have access to any Win7 machine right now i'll give you 2 answers, one that I know that works in winXP and one that I found but don't know if it works in Win7.

0
0

Update for Windows 10 when CMD was replaced by PowerShell:

For quite some time, there is a PowerShell module called OpenHere that gives you granular options to control this functionality.

All you need is to copy paste this into PowerShell with elevated rights:

Install-Module -Name OpenHere; Import-Module -Name OpenHere

and start to explore the Set-OpenHereShortcut function.

Disclosure:

I'm a developer of this module.

2
  • Incomplete answer. i don't know what this means: "start to explore the Set-OpenHereShortcut function." Also, powershell doesn't replace cmd completely. This question is about cmd, not powershell.
    – johny why
    Sep 20, 2020 at 17:56
  • Get-Help Set-OpenHereShortcut. PowerShell does replace CMD completely but you can work with CMD shortcut if you wish. Kindly RTFD.
    – KUTlime
    Sep 21, 2020 at 8:05
-2

For Mac:

Head into System Preferences and select Keyboard > Shortcuts > Services. Find "New Terminal at Folder" in the settings and click the box. Now, when you're in Finder, just right-click a folder and you're shown the open to open Terminal.

source: https://lifehacker.com/launch-an-os-x-terminal-window-from-a-specific-folder-1466745514

2
  • 1
    Welcome to Super User, and thanks for contributing to our knowledge base!   Unfortunately, this question is about Windows, and so your answer is at risk of being deleted.   I suggest that you (1) search our site to see whether this information is already available (and findable), and, if it isn’t, (2) post (ask) a new question, that is the same as this question, but for Mac, and then (3) post this answer there.   (This is absolutely allowed and encouraged.   High-rep users can do steps 2 and 3 simultaneously.   Since you’re a new user, … (Cont’d)
    – Scott
    Nov 12, 2018 at 0:33
  • (Cont’d) …  the system may force you to wait a few minutes (or hours?) between steps 2 and 3.)  … … … … … … … … … … P.S. Thanks for providing the information and linking to the source.
    – Scott
    Nov 12, 2018 at 0:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.