3 ways to change the Command prompt directory

Here are various ways to change the command prompt directory in Windows 10/11: Let’s start with perhaps the simplest, the cd command. Use the cd command to change the command prompt directory

You can easily jump from one directory (folder) to another by using the cd command (short for changing directory). At the command prompt, type cd and press Enter. From there, go directly to the top of the command prompt directory. You will be redirected to the root directory of your Windows C: drive so that you can see it on the command prompt screen.

To go to a specific directory, type cd followed by the directory name. For example, here I switched to the download directory at the root of Windows 10. For multiword indexes, you may need to enclose the name in quotation marks. Example: B. Insert a “onenote notebook” tip here. Start typing the directory name, then press Tab, and Windows will type the name. If you have multiple directories with similar names (File 1, File 2, File 3, etc.), holding down the Tab key will cycle through the windows for possible matches.

.

changing directories in the cmd

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 in cd .., and hit Enter, as we’ve done in our Windows 11.

running the cd command in cmd

Changing the drive in Command prompt

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 in to your “D:” drive, just type in “D:” in the Command prompt and hit the Enter.

Another thing to keep in mind is that the Command prompt 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:”—the Command prompt will interpret both of them as the same.

Another command that deserves a special mention is the dir command. Type in the dir in the Command prompt and you’ll see a list of files and folders inside the parent directory.

running dir command in cmd in windows 11

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 Command prompt here. Type in cd in the Command prompt, drag the folder that you want to move in into the Terminal, and hit Enter.

The Command prompt will directly switch to the desired folder.

Leave a Comment

Your email address will not be published. Required fields are marked *