Written by
Yuri ZhangChanging directories (also known as navigating folders) in Command Prompt (CMD) is a fundamental task for any Windows user exploring the command-line interface.
Whether you're trying to access a specific folder, run scripts, or manage files more efficiently, knowing how to change directories is crucial. Now let's delve into how to change directories in Command Prompt on Windows 10.
What is a directory?
In Windows, a directory is just another name for a folder. When you open a folder in File Explorer, you're viewing its contents visually. In Command Prompt, directories are accessed using text commands, and you need to tell the system exactly where to go.
Tips: You can launch Command Prompt by pressing Windows + R, then typing cmd, and hitting Enter, or just searching for Command Prompt in the Start Menu.
Basic syntax to change directory: cd command
The command used to change directories is:
cd [directory_path]
Undoubtedly, cd stands for "change directory". The directory_path is the full path or relative path of the folder you want to navigate to.
1. Change to a folder in the same directory in CMD on Win 10
If you're already in C:\Program Files\office, and there's a folder called Documents, in CMD, just type the following and press Enter:cd Documents
To go back one directory (up to the parent folder), use the command:cd ..
To go up two levels:cd ..\..
Bonus tips
1. Use this command to view the current directory or check where you are:cd
2. If you're unsure of folder names, use dir to list folder contents:dirThis lists all files and folders in the current directory.
Share these and continue to see more tricks of changing directory to another place.
2. Navigate to another drive in CMD on Windows 10
If you want to go from the C: drive to the D: drive. First, select the D: drive with the command:D:
Then to change to a folder such as Games or Documents on that drive:cd Games
Tips: Just typing cd D:\Games while on the C: drive will show the directory path, but won't change the drive. Use D: first to switch drives.
3. Use the full path to change directories in CMD on Win 10
To go directly to a folder regardless of your current location:cd C:\Program Files\Google\Chrome\Application
Pay attention to be sure to use quotes if the path includes spaces in case it doesn't work:cd "C:\Program Files\Google\Chrome\Application"
Common errors and fixes
To prevent possible error indicators, you can check this table to solve your problem:
Error Message | Cause | Solution |
"The system cannot find the path..." | Wrong directory name or path | Check spelling and folder existence |
"Access is denied" | Lack of admin rights | Run CMD as administrator by right-clicking CMD when open it. |
"CMD shows wrong drive" | Drive not changed properly | Type the drive letter (e.g., E:) |
Conclusion
Changing directories in Command Prompt is simple once you understand how paths and commands work. Start by using cd, learn how to move between drives, and always double-check your folder names. With practice, you'll be navigating Windows folders like a pro.
Related articles:
How to format the C drive from Command Prompt on Windows
Del command: file and folder deletion in Windows CMD
Practice makes perfect. Adopt these steps to rearrange your files and folders.