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

Solution 1:

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)

Solution 2:

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.