[windows] Need to navigate to a folder in command prompt

My command prompt starts in C:\Users\ (Name) and I need it to be in a different folder, how can I do this using the command prompt itself?

This question is related to windows cmd

The answer is


When I open a "DOS" command prompt, I use a batch file which sets all of the options I need and adds my old-time dos utilities to the path too.

@set path=%path%;c:\utils
@doskey cd=cd/d $*
@cd \wip
@cmd.exe

The doskey line sets the CD command so that it will do both drive and folder simultaneously. If this doesn't work, it is possibly because of the version of windows that you're running.


Just use the change directory (cd) command.

cd d:\windows\movie

To access another drive, type the drive's letter, followed by ":".

D:

Then enter:

cd d:\windows\movie

I prefer to use

pushd d:\windows\movie

because it requires no switches yet the working directory will change to the correct drive and path in one step.

Added plus:

  • also works with UNC paths if an unused drive letter is available for automatic drive mapping,
  • easy to go back to the previous working directory: just enter popd.

In MS-DOS COMMAND.COM shell, you have to use:

d:

cd \windows\movie

If by chance you actually meant "Windows command prompt" (which is not MS-DOS and not DOS at all), then you can use cd /d d:\windows\movie.


Navigate to the folder in Windows Explorer, highlight the complete folder path in the top pane and type "cmd" - voila!