logo
Windows 10 Change Directory Path in Windows 10 Command Prompt

How to Use CMD to Change Dir Path in Windows 10 Command Prompt?

By Lydia | Last Updated

When using the Command Prompt, we may need to switch to different directories for various operations. For example, switching from a subdirectory on the C drive to a subdirectory on the D drive. Each operation has its corresponding command; try to practice and master directory change command line in windows 10.

Change Dir Path

Way 1: Through Specific Folder Path Bar

Enter the folder where you need to execute the cmd command. In the folder's path bar, enter "cmd" and then press Enter. The Command Prompt Window will pop up with the directory path the same as the folder path.

Type CMD in Directory Path

Way 2: Drag the Folder Directly into the Command Prompt Window

If the folder is right on the desktop, you can quickly change to this directory path by typing "cd" and drag the folder into the window. Press "Enter", then you can perform command line operations on this folder.

cd Desktop Folder

Way 3. Through cd Command Line

When you enter Command Prompt Windows, the path shows the current Windows user’s directory by default:

The cd command prompt is frequently used. If you want to go to a subfolder under the current folder directory, you can directly:

cd Desktop

cd Subfolder

If you want to enter multiple layers of subdirectories in the current directory at once, you can directly input the relative path of the directories:

cd Desktop\test

cd Multiple Subfolder

To go back to the previous directory, use the following command:

cd ..

Get back to Previous Folder

To go back multiple levels, you can combine multiple instances of '..' together:

cd ..\..

Get back to Multiple Previous Folder

Other useful directory switching commands:

'cd %userprofile%' command to switch to the current user's home directory.

cd User Home Directory

'cd \' command to switch to the root directory.

cd Root Directory

Way 4: Change the Drive at Command Prompt

cd /d d:

Change Drive Path

To directly get into subfolder in another drive, you need to type into its absolute path:

cd /d d:/test

Tips for cd Command Prompt

Tips 1: If you want to quickly change directories though cd disk cmd, you can first type `cd`, then press Tab. It will cycle through the folders in the current directory in alphabetical order (special characters first, followed by numbers, and then letters).

Tips 2: For a limited range, you can type `cd` followed by the first few letters of the directory. Press the Tab key multiple times until the correct directory appears. If the initial letters are unique to the desired folder, you can use the Tab key to auto-complete the directory name.

Tip 3: Check the content in current directory:

dir

dir Command

Related Articles: