Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I open a cmd window in a specific location?

Tags:

windows

cmd

How can I open a cmd window in a specific location without having to navigate all the way to the directory I want?

like image 818
Haim Bender Avatar asked Sep 13 '08 21:09

Haim Bender


2 Answers

This might be what you want:

cmd /K "cd C:\Windows\" 

Note that in order to change drive letters, you need to use cd /d. For example:

C:\Windows\System32\cmd.exe /K "cd /d H:\Python\" 

(documentation)

like image 161
Allain Lalonde Avatar answered Sep 23 '22 10:09

Allain Lalonde


If you have Windows Vista or later, right-click on the folder icon in Explorer while holding the Shift key, and then click on the "Open command window here" or "Open PowerShell window here" context menu option.

If you're already in the folder you want, you can do one of the following:

  • [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.

For Windows XP, use the PowerToy mentioned by dF to get the same function.

like image 45
Michael Ratanapintha Avatar answered Sep 23 '22 10:09

Michael Ratanapintha