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.
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.
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.
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
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
To go back to the previous directory, use the following command:
cd ..
To go back multiple levels, you can combine multiple instances of '..' together:
cd ..\..
Other useful directory switching commands:
'cd %userprofile%'
command to switch to the current user's home directory.
'cd \'
command to switch to the root directory.
cd /d d:
To directly get into subfolder in another drive, you need to type into its absolute path:
cd /d d:/test
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
Related Articles: