Skip to content

CD Windows command

The Windows cd command is a powerful tool used in the command prompt to navigate through different directories on your computer. This command allows you to change the current directory to another directory of your choice quickly and easily. By typing “cd” followed by the desired directory path, you can move between folders, access files, and execute commands in a specific location. The cd command is an essential feature for anyone working in the command line interface, as it helps to streamline file management tasks and improve productivity. It is a fundamental command that every Windows user should be familiar with in order to efficiently navigate their file system.

CD Syntax:

Terminal window
cd [drive:][path]

Windows CD Options:

OptionDescription
/DChange current drive in addition to changing folder/path

CD Parameters:

ParameterDescription
drive:Specifies the drive to change to
pathSpecifies the directory or path to change to

How to use CD command:

Change to a Different Directory

Terminal window
cd Documents

Changes the current directory to “Documents”.

Go up One Directory Level

Terminal window
cd ..

Moves up one level in the directory structure.

Move to the Root Directory of a Drive

Terminal window
cd /

Changes the current directory to the root directory of the drive.

Terminal window
cd C:\Program Files

Changes the current directory to the specified folder path.

Return to the Previous Directory

Terminal window
cd -

Returns to the previous directory that was accessed.

List Available Drives

Terminal window
cd /

Lists all available drives along with the drive letter.

Access a Shared Network Folder

Terminal window
cd \\servername\sharedfolder

Navigates to a shared network folder by specifying the server name and the shared folder name.

Create a New Directory and Move Into It

Terminal window
md NewFolder & cd NewFolder

Creates a new directory named “NewFolder” and then moves into that directory.

How do I use cd in CMD?

To use the cd command in CMD, execute the following command:

Terminal window
cd C:\Users

How can I change to a specific directory in CMD?

To change to a specific directory using the cd command, provide the full path to the desired directory as follows:

Terminal window
cd C:\Program Files

How do I navigate up one level from my current directory in CMD?

To navigate up one level from your current directory in CMD, use the following command:

Terminal window
cd..

How can I switch to a directory located on a different drive in CMD?

To switch to a directory located on a different drive in CMD, use the drive letter followed by a colon and the path to the directory:

Terminal window
cd D:\Documents

How do I go back to the previous directory in CMD?

To go back to the previous directory in CMD, use the following command:

Terminal window
cd -

How can I change to a directory using a relative path in CMD?

To change to a directory using a relative path in CMD, specify the location relative to your current directory:

Terminal window
cd Documents

How do I list the contents of a directory after changing to it in CMD?

To list the contents of a directory after changing to it in CMD, execute the following commands:

Terminal window
cd Documents
dir

How do I display the full path of the current directory in CMD?

To display the full path of the current directory in CMD, enter the following command:

Terminal window
cd

How can I change to a directory with a space in its name in CMD?

To change to a directory with a space in its name in CMD, enclose the directory name in double quotation marks:

Terminal window
cd "Program Files"

Applications of the CD Command

  1. Change the current working directory
  2. Navigate between different directories
  3. Switch between drives
  4. Access specific folders or subdirectories
  5. Change directories in a batch file