askvity

# Changing Your Current Directory in CMD

Published in CMD Navigation 4 mins read

Changing your directory, also known as changing your current working folder, in the Command Prompt (CMD) is a fundamental skill for navigating your computer's file system efficiently. This process allows you to execute commands and access files within a specific location without typing the full path every time.

Changing Your Current Directory in CMD

To change your current directory in Command Prompt, you will primarily use the cd command, which stands for "change directory." There are two main methods to specify the new directory: typing its path directly or using a convenient drag-and-drop feature.

Method 1: Using the cd Command Directly

This is the most common method, involving typing the cd command followed by the desired directory's path.

  1. Open the Command Prompt (CMD): You can do this by searching for "CMD" or "Command Prompt" in your Windows search bar and pressing Enter.
  2. Type the cd command: Type cd followed by a space.
  3. Specify the Directory Name: Enter the full path to the directory you wish to navigate to. For example, if you want to go to a folder named "Projects" inside your "Documents" folder, you might type cd C:\Users\YourUsername\Documents\Projects.
  4. Press Enter: After typing the command and the directory path, press the Enter key to execute the command and change your current directory.

Example:
To change your directory to a folder named MyDocs located directly under your C:\ drive, you would type:
cd C:\MyDocs

Method 2: Drag and Drop from File Explorer

This method offers a quick way to input a directory path without typing it manually.

  1. Open the Command Prompt (CMD): As mentioned above, open CMD.
  2. Open File Explorer: Navigate to the desired directory in File Explorer.
  3. Drag and Drop: Click and drag the folder icon of the desired directory from File Explorer directly into the Command Prompt window. The full path of the directory will automatically appear after the cd command (which you should type first, followed by a space).
  4. Press Enter: Once the path appears in CMD, press Enter to change your directory.

Navigating Up One Level (Going Back)

To move back to the parent directory (the directory one level above your current location), you can use a special variation of the cd command.

  1. Type cd..: In the Command Prompt window, type cd.. (note the two periods immediately following cd).
  2. Press Enter: Press Enter to execute the command. This will move your current working directory up one level.

Example:
If your current directory is C:\Users\YourUsername\Documents\Projects, typing cd.. will change your directory to C:\Users\YourUsername\Documents. If you type cd.. again, it will take you to C:\Users\YourUsername.

Essential cd Commands Summary

Understanding these basic commands is crucial for efficient navigation within the Command Prompt.

Command Description Example Usage
cd [path] Changes the current directory to the specified [path]. [path] can be absolute or relative. cd C:\Program Files
cd [dragged] Allows dragging a folder from File Explorer into CMD to automatically input its path after cd. cd C:\Users\Admin\Desktop\NewFolder (after drag)
cd.. Moves the current directory one level up to its parent directory. cd..

By mastering these simple cd commands, you can efficiently navigate through your file system using the Command Prompt.

Related Articles