This guide covers 5 options to change the directory in Command Prompt.
Option 1: Change to Root Directory
To change directory in Command Prompt to the root directory, enter the command below and press enter.
cd\
In this example, my Command Prompt is in the path “C:\Users\Victo”. To change to the root of C:. I will enter cd\ command and press enter on my keyboard. See the second image below – the directory is now in the root of C.
Option 2: Change Directory One Step from the Current Directory
You can also change directory, one directory behind the current directory. To do this, enter this command and press enter.
cd..
or
cd ..
Here is an example. My current Command Prompt is on “C:\Users\Victo”. However, I want to change it to “C:\Users” – here are the screenshots…
Option 3: Change Directory to Another Drive
If you are currently in a drive and want to change to another drive, enter the drive name, followed by a colon and the /d switch. Then, press enter. For example to change from drive C to E, enter the command below and press enter.
e: /d
Option 4: Change Directory to a Full Path
You can also change directory in Command Prompt to a specified path. In this section, I will show you how to cd to a path on the same drive and on a different drive.
To change to a path on the same drive, enter cd followed by the full path you want to cd to – better to enclose the path in a double-quote (“”). In this example, I want to change to “C:\ESD”, I will enter this command and press enter…
cd "C:\ESD"
Command Prompt will change to the specified directory…
However, to change to a directory in a different drive, enter cd, followed by the full path. Then, run a second command – the new directory drive letter, followed by colon (:).
In the next example, I want to change from “C:\ESD” (current directory) to “E:\Archives” – a directory in another drive. I will use the following commands.
cd "E:\Archives"
e:
Here is the result of the commands in CMD…
Option 5: Change to a Directory in the Current Directory
There is a final option to change directory in Command Prompt – you can change to a directory in the current directory. To demonstrate this, I will first list all directories in the current directory with the dir command.
In this example, my CMD is in the path, “C:\G-Drive-P”. To list all directories in “G-Drive-P”, I will enter the command below and press enter.
dir
The “G-Drive-P” has 3 directories – “Reports”, “Operations Tools” and “Work Tools”.
To change to “Work Tools” directory, I will use the command below…
cd "Work Tools"
Command Prompt will change to the new directory.
Conclusion
You can use the options in this Itechguide to Change Directory in Command Prompt!
I hope you found this Itechguide helpful. If you found it helpful, click on “Yes” beside the “Was this page helpful” question below.
You may also express your thoughts and opinions by using the “Leave a Comment” form at the bottom of this page.
Finally, for more Windows Command Prompt Itechguides, visit our Windows Command Prompt page.