How to change the folder in Command Prompt on Windows 10

One of the first things you need to learn when you become more familiar with the Command Prompt on Windows 10 is how to change the folders in the file system of the operating system. The following article will guide you to implement them.

One of the first things you need to learn when you become more familiar with the Command Prompt on Windows 10 is how to change the folders in the file system of the operating system. There are several ways you can do this, so the following article will guide you through them.

Change directories by drag and drop method

If the folder you want to open in Command Prompt is on the screen or opened in File Explorer, you can quickly change it. Enter cdfollowed by a space, drag and drop the folder into the window, and then press Enter.

The directory you move to will be reflected in the command line.

How to change the folder in Command Prompt on Windows 10 Picture 1How to change the folder in Command Prompt on Windows 10 Picture 1 The directory you move to will be reflected in the command line

Change the directory right in Command Prompt

It is not always convenient to open File Explorer, then drag and drop. That's why being so great at typing a command to change the directory right in the Command Prompt is so great.

For example, you are in the user directory and there is a Documents folder in the next file path. You can type the following command in Command Prompt to switch to that directory:

cd Documents

Note that this only works if you are in the temporary file structure. In the example case, that would be (user directory)> Documents . In the current directory, this method cannot be used to navigate to a nested directory on two levels.

So, suppose you are currently in the user directory and want to move to the How-To Geek folder , located in Documents. If you try to jump straight into How-To Geek without going to Documents , you will get an error like in the image below.

How to change the folder in Command Prompt on Windows 10 Picture 2How to change the folder in Command Prompt on Windows 10 Picture 2 An error will occur if you move to a nested folder on two levels

As mentioned earlier, you are currently in the user directory. Type cd Documentsin Command Prompt to access Documents.

You are now in the Documents folder . To move down another level, enter cdon the command line followed by the name of the directory.

How to change the folder in Command Prompt on Windows 10 Picture 3How to change the folder in Command Prompt on Windows 10 Picture 3 Need to move in turn to each folder level

Now, suppose you go back to the user directory and want to skip the extra step to jump down two directory levels. In the example case, this will be the How-To Geek folder . Type the following command:

cd DocumentsHow-To Geek

This allows moving 2 directory levels with one command.

cd DocumentsHow-To Geek
How to change the folder in Command Prompt on Windows 10 Picture 4How to change the folder in Command Prompt on Windows 10 Picture 4 Move 2 levels of folders with one command

If you've entered the wrong directory and want to go back, type the following command:

cd. .

This command allows you to move up one level.

How to change the folder in Command Prompt on Windows 10 Picture 5How to change the folder in Command Prompt on Windows 10 Picture 5 Move up one directory level

Navigation tips

If you want to make a little more efficient change of directory, enter cdthe command line, followed by the first few letters of the directory you want. Then, click Tabto automatically complete the folder name.

How to change the folder in Command Prompt on Windows 10 Picture 6How to change the folder in Command Prompt on Windows 10 Picture 6 Press Tab to autocomplete folder name

Alternatively, you can type cd, followed by the first letter of the folder, then press Tabmultiple times until the correct folder appears.

How to change the folder in Command Prompt on Windows 10 Picture 7How to change the folder in Command Prompt on Windows 10 Picture 7 Press Tab repeatedly until the correct folder appears

View directory content

If you're disoriented and don't know where to go next, you can view the contents of the current directory by typing dirin the command line.

How to change the folder in Command Prompt on Windows 10 Picture 8How to change the folder in Command Prompt on Windows 10 Picture 8 View directory content

This will give you a hint on which folder to navigate next.

3.7 ★ | 6 Vote