Is there a way to open command prompt in current folder?
Asked Answered
M

7

38

I have a project folder somewhere, and many times I need to open command prompt (on windows 7/8.1/10) and cd to that folder. It would be very handy if there's an option right click > open cmd here. is there a tool for that?

Murdoch answered 20/10, 2016 at 5:27 Comment(0)
D
147

Just go to your folder location and type "cmd" on the address bar.

Dualpurpose answered 20/10, 2016 at 5:34 Comment(3)
without mouse: Ctrl + L = jump to address bar, and after type "cmd"Homologous
You can also use Alt + D to switch focus to the address bar.Strictly
but no "elevated" possible :(Stuffy
C
7

Press Shift + Menu, then choose Open Command Window Here. It works.

Chryso answered 20/10, 2016 at 5:31 Comment(2)
that worked, thanks a lot. can I open it as an administrator?Murdoch
Look at this superuser.com/questions/453409/… . Note, you need to alter the register. So, be careful ).Chryso
D
4

How about to use the PowerShell OpenHere module?

Run PowerShell with elevated permissions and type:

Install-Module OpenHere; Import-Module OpenHere
Set-OpenHereShortcut -ShortcutType:WindowsPowerShell

Disclaimer:

I'm a developer of this module.

Demography answered 23/2, 2020 at 19:44 Comment(0)
L
4

Type cmd command in address bar where path or location of the file or folder is shown.

Letta answered 14/8, 2022 at 8:35 Comment(0)
E
3

In win7/8, try right click while holding shift key, should have cmd prompt here

Enquire answered 20/10, 2016 at 5:28 Comment(0)
S
2

use the description in https://mcmap.net/q/80474/-how-can-i-open-a-cmd-window-in-a-specific-location and put "run as administrator" checkbox on

  1. Open 'File Explorer' and enter "shell:sendto" in location bar + hit return to get into this folder
  2. Right mouse click and create a "New"->"Shortcut", put cmd.exe into the path, done
  3. Edit the properties of the shortcut and edit the target to "%windir%\system32\cmd.exe /k pushd"
  4. you can also create a copy of that shortcut, rename it to cmd.exe_admin, select properties, hit button "Advanced" an select the checkbox "run as Administrator"

Now use the "SendTo"-submenu in the explorer right click context menu to send any filepath or folder into the normal or elevated commandbox.

This "shell:sendto"-trick is also very useful for eg. Notepad++ or any program you want to start in "elevated" mode.

Stuffy answered 5/7, 2022 at 12:42 Comment(0)
B
0

You can add an own context menu point in your explorer by adding a new entry in your registry.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmdPromptHere]
@="Open command prompt here"

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

The default string value in the root key cmdPromptHere defines the displayed string in the context menu. Without this default value the displayed string equals the chosen reg key itself ("cmdPromptHere").

This new context menu is displayed on any folder node in the explorer.

If you do not want to edit the registry manually, copy above code to a text file with suffix ".reg" and double click that file in the explorer.

Works in Windows 10

Balbinder answered 30/5 at 8:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.