How to Change Directory in CMD [Windows 10/11]

alison-d
By  
how-to-change-directory-in-cmd1

The cd command, short for Change Directory, is one of the core navigation commands in Windows Command Prompt (CMD). It lets users move from one folder to another through the terminal interface instead of using File Explorer. If you’ve ever wondered how to change directory in CMD on Windows 10 or 11, this article will guide you through everything you need to know—from the basic syntax to practical, real-world examples. Knowing how to use change directory in CMD is essential for many tasks, including troubleshooting, managing files, and running advanced tools like winfr (Windows File Recovery), which require precise folder paths. Whether you’re a beginner or just want to improve your command line skills, mastering the cd command will save you time and prevent errors. By understanding this simple but powerful command, you’ll be able to navigate your system’s file structure more efficiently and confidently.

Basic Syntax

cd [path]

path: The name or path of the directory you want to move to.  

To switch drives, add the /d flag:

cd /d D:\Recovery

Parameter Description

Here are some commonly used cd command variations and what they do:

Command SyntaxDescription
cdDisplays the current working directory
cd foldernameEnters a specified subfolder
cd ..Moves up one level to the parent directory
cd \Navigates to the root directory of the current drive
cd /d D:\folderSwitches drive and directory at the same time
cd "folder name"Handles folder names that contain spaces using quotes

Note: This command is the same as the chdir command.

Usage Examples

Now that you understand the basic cd syntax and parameters, let’s walk through some practical examples. These will help you navigate real-world directory structures more confidently—especially when you’re working on complex file systems or preparing paths for recovery using tools like winfr.

Here are five advanced usage examples that demonstrate how to use cd effectively:

1. Change to a Deep Subdirectory Across Drives

  • Step 1: Open CMD and type cd /d to indicate you want to change both the drive and directory.
  • Step 2: Type the full path of the target folder on the other drive, for example: D:\Work\2024\Reports\Q4\Drafts.
  • Step 3: Press Enter to switch directly to that nested folder on drive D:

cd /d D:\Work\2024\Reports\Q4\Drafts

Explanation: Switches to a deeply nested folder on the D: drive. Use /d to change both the drive and directory at once—essential when working across multiple drives.

2. Navigate Using a Relative Path

Step 1: From your current directory, decide how many levels you need to go up. Each .. means one level up.

Step 2: After moving up the required levels, specify the folder you want to enter relative to that point, e.g., Shared\TeamDocs.

Step 3: Run the command and hit Enter to move to the folder using this relative path.

cd ….\Shared\TeamDocs

Explanation: Moves two levels up from the current directory, then into Shared\TeamDocs. Useful for structured folder hierarchies in project environments.

3. Enter a Folder with Spaces or Special Characters

Step 1: Start typing the cd command followed by a space.

Step 2: Because folder names can include spaces or special characters (like apostrophes), wrap the entire path in double quotes " ".

Step 3: Press Enter to change directory without errors caused by spaces or special symbols.

cd “E:\User Files\John_O’Connor\Project_A”

Explanation: When folder names contain spaces or characters like apostrophes, wrap the path in double quotes to avoid errors.

4. Combine with winfr: Prepare Destination Folder

Step 1: Change to the main recovery directory on the desired drive using cd /d.

Step 2: Use mkdir to create a new folder for your recovered files—this step prevents overwriting existing data.

Step 3: Use cd again to enter the newly created folder, setting it as your working directory.

cd /d D:\Recovery\Photos && mkdir Vacation && cd Vacation

Explanation: Navigates to D:\Recovery\Photos, creates a new folder named Vacation if it doesn’t exist, and then enters it. This is a useful prep step before running a recovery command.

5. Validate Path Before Running winfr

Step 1: Navigate to the folder containing the lost files to confirm the path is correct.

Step 2: Once confirmed, execute the winfr command, specifying the source drive, destination folder, recovery mode, and file filters.

Step 3: Use quotes around filters if your path or file types include spaces or special characters.

cd /d C:\Users\Alex\Documents && winfr C: D:\Recovered /regular /n “Users\Alex\Documents*.docx”

Explanation: First navigates to the source folder to ensure it exists, then executes the winfr command to recover Word documents. This ensures accuracy and prevents errors in automated recovery scripts.

Why Changing Directory Matters for Winfr

winfr is a powerful Microsoft command-line tool for recovering lost or deleted files on Windows 10 and 11. It requires precise paths for the source (where files were lost) and the destination (where recovered files will be saved).

For example, this command attempts to recover all .docx files from drive C: and save them in the D:\Recovery folder:

winfr C: D:\Recovery /regular /n *.docx

Before running such commands, you often need to change directory to the recovery folder to check or prepare it:

cd /d D:\Recovery

Using Winfr: Basic Command and Parameters

winfr supports several recovery modes:

ParameterDescription
/regularRecover recently deleted files
/segmentRecover files using file segments (more thorough)
/signatureRecover files by signature (for severely damaged files)

Example recovering all .jpg images:

winfr C: D:\Recovered /signature /n *.jpg

Common Problems When Using cd and Winfr

No recovered files visible: Check the destination folder you navigated to with cd. the wrong location.

Path not found: Make sure folder names and paths are correct, especially case-sensitive parts.

Drive not changing: Use /d to change drives with cd.

Spaces in folder names: Use quotes to avoid errors.

Winfr command fails: Double-check source/destination directories with cd before running recovery.

Graphical Alternative for File Recovery

If all this command-line work feels overwhelming, there’s a user-friendly alternative: WinfrGUI.

WinfrGUI is a free graphical interface for Microsoft’s Windows File Recovery tool. It eliminates the need for any CMD commands and lets you recover files with just a few clicks.

Why Choose WinfrGUI?

✅ No CMD skills required
✅ Supports all recovery modes from winfr
✅ Preview files before recovery
✅ Recover documents, photos, videos, and more
✅ 100% free for Windows 10/11

How It Works

  1. Select the drive you want to scan (e.g., C:)
  2. Choose the folder to save recovered files (e.g., D:\Recovered)
  3. Choose file types or scan entire drives
  4. Click “Start Recovery”

Whether you’re a casual user or someone recovering business documents, WinfrGUI makes the process much easier.

CommandDescriptionLearn More
winfrWindows File Recovery commandWinfr CMD
dirList files and directoriesMicrosoft Docs
attribManage file attributesRecover Hidden Files
chkdskFix disk errorsFix SD Card Not Detected

Conclusion

If you’re using Command Prompt on Windows, knowing how to change directory in CMD is essential. It’s the foundation for performing advanced tasks, from script automation to file recovery using winfr. Whether you’re navigating to a directory to find a file or recovering data after accidental deletion, mastering the cd command gives you more control over your system.And if command-line tools aren’t your thing, WinfrGUI offers a visual, beginner-friendly way to recover lost data—no CMD knowledge needed. Still have questions? Learn more in our WinfrGUI tutorial or read how to recover permanently deleted files on Windows 11 for real-world examples.

🔗 Also Read: Fix Common Steam CMD Errors on Windows 10/11