Config Server Firewall

How To Change Directory in CMD (Command Prompt)

how to change directory in cmd

To change the directory in CMD, we use the CD command. Alternatively, you can use the chdir command, which works the same way.

CD path
CHDIR path



Change to the data directory. Since we don't specify the absolute path (full path), the data directory is a subfolder inside the current working folder.

cd data

Change the directory to C:\Program Files:

cd "C:\Program Files"

Change to the parent directory of the current folder:

cd ..

Change the drive. For example, I am currently working in the C: drive, if I want to change to D: drive, I have to use /D switch:

cd /d E:
command prompt change drive

The following command changes the directory to the root of the current drive:

cd \
how to change directory in command prompt