63

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?

Mokubai
  • 89,133
  • 25
  • 207
  • 233
Catherine
  • 633
  • 1
  • 5
  • 4
  • @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… – Franck Dernoncourt Jul 14 '15 at 17:18

6 Answers6

121
  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.
sofly
  • 1,346
  • 1
  • 8
  • 6
  • 3
    #2 is a neat trick, it’s a shame it doesn’t work (in Windows 10) for UNC paths. – Richard Aug 25 '20 at 10:05
  • 2
    #1 not working for me on Win 10. I get PowerShell. – johny why Sep 20 '20 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: https://superuser.com/a/1202148 – sofly Oct 19 '20 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 '20 at 22:17
  • 3
    Number **1.** is good to open **Powershell**, number **2.** is good for **classic command line**. – Beauty May 05 '21 at 20:11
  • I use number 2 with PowerShell with no problem? – Ooker Oct 06 '21 at 14:16
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
phuclv
  • 26,555
  • 15
  • 113
  • 235
Franck Dernoncourt
  • 20,384
  • 48
  • 186
  • 322
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.

phuclv
  • 26,555
  • 15
  • 113
  • 235
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"=""
phuclv
  • 26,555
  • 15
  • 113
  • 235
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.

KUTlime
  • 131
  • 3
  • 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 '20 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 '20 at 08:05
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.

Jamiro14
  • 161
  • 1
  • 5