Updated December 5, 2022.
The Command Prompt, sometimes also referred to as cmd.exe or cmd, is a command line interpreter in Windows operating system, and has been in use since the earliest days of Microsoft operating systems, dating back to the DOS days. Offered as an alternative to Windows GUI, CMD offers far more control and functionalities to the average Windows user, than the normal GUI ever can.
But, before you can perform any wizardry with the CMD, you’ll first have to learn how to change directories in it. In this article, we’ve covered some of the easiest methods to change your Command Prompt directory in Windows 10 and Windows 11.
Change your Command Prompt directory with the cd command
The cd command, short for “Change Directory,” lets you jump from one directory (folder) to another without a lot of hassle. Here’s what you need to do.
- Type in cd in the Command Prompt and hit Enter. From there, you’ll be taken to the top of your Command Prompt directory instantly. As you will see on your Command Prompt screen, you’ll be taken to the root directory in Windows “C:” drive.
- To move into a particular directory, just enter cdfollowed by the directory name. For instance, we moved into the Downloads directory located inside the root directory of our Windows 10 here.
- For multiple-word directories, you may have to enclose the name in quotes, for example, cd “OneNote notebooks”- one tip here, you can start typing a directory name and then hit the Tab key, and Windows will fill in the name for you. If you have multiple directories with similar names (say files 1, files 2, files 3, etc) keep hitting the Tab key, and Windows will cycle through the possible matches.
- Alternatively, instead of going straight to the root directory, you can also go back to the previous folder by adding .. after cd command. So, go into your Command Prompt, type cd .., and hit Enter.
Changing the drive in CMD
If, in contrast, you want to change your directory altogether, then you’ll have to type the drive name, followed by :. So, if you’re in the “C:” drive right now, and you’d like to move into your “D:” drive, just type in “D:” in the CMD and hit Enter.
Another thing to keep in mind is that the CMD is case-insensitive, meaning that it treats capital and small case letters as the same. So, it doesn’t matter if you type “D:” or “d:”—CMD will interpret both of them as the same.
Another command that deserves special mention is the dir command. Type in the dir in the CMD and you’ll see a list of files and folders inside the parent directory.
Now, if you want to go inside a specific directory from here, just use the cd command from above, along with the name of the directory, as we did above.
Change directories in CMD by dragging the folder
You can also use the GUI along with the CMD here. Type in cd in the Command Prompt, drag the folder that you want to move in into Windows Terminal, and hit Enter. CMD will switch directly to the desired folder.
Changing directories in CMD
If becoming a pro in Windows Terminal is what you’re after, then being able to change your terminal directories is just one of many hacks you’ll be mastering along the way. Make no mistake, as this is only the beginning, and you’ll be learning a lot more when you dive into the Command Prompt more in-depth.