How To Change Directory in CMD | Command Prompt

The command prompt is a valuable tool for any computer user. It allows you to change directories, view the contents of your hard drive, and even change how your computer runs.

CMD is a command line interpreter for the Microsoft Windows operating system. The name “CMD” is an abbreviation of “command”.

How to Change Directories in CMD in Windows 10 and 11

To change the directory in Command Prompt, first, open the Command Prompt by searching for “cmd” in the Start Menu and hitting Enter. Then type “cd” followed by the name of the directory you want to change to and press Enter. See the steps below.

  1. First, open the Command Prompt by typing “cmd” into the Start Menu search bar and hitting Enter. Once the Command Prompt is open, you’ll be in the home directory for your Windows account. You’ll see a blinking cursor. This indicates that cmd is ready to accept commands.
  2. To change the directory, simply type “cd” followed by the name of the directory you want to change to and press Enter.

Tip: Type “dir” first to display the list of files and directories in the current directory. Then you can use the “cd” command to change into one of these listed directories.

Open CMD in Windows 10 and 11
Open CMD in Windows 10 and 11
Change Directories in CMD in Windows 10 and 11
Change Directories in CMD in Windows 10 and 11

For example, if you want to change to your Documents folder, you would type “cd Documents“.

If you want to change back to your root directory, you would type “cd..“.

That’s all there is to it. With a few simple commands, you can easily navigate through your computer’s file system.

Relative Paths

You can also use relative paths to specify the directory you want to change to. A relative path is relative to your current working directory and begins with a list of all of the directories that lead up to the desired directory.

For example:

  • If you are currently in your home directory and want to change to the “Documents” directory, you would type “cd Documents“.
  • If you are currently in your home directory and want to move up one level to your user profile directory, you would type “cd ..“.
  • Lastly, if you want to return to the root directory at any time while using the Command Prompt, you can simply type “cd\” and hit Enter.

ALSO READ: How To Password Protect a Folder

Change The Drive in Command Prompt

If you want to change the drive that the Command Prompt is currently using, simply type the drive letter followed by a colon.

  • For example, if you want to switch from your C: drive to your D: drive, you would type “d:” and hit Enter.
  • To change back to your C: drive, you would type “c:” and hit Enter.

Keep in mind that you can only change drives if they exist on your computer. If you only have one hard drive, then you will only be able to access your C: drive.

ALSO READ: How to Change Browser Settings

List the Directories in Command Prompt

If you want to see directory contents or a list of all of the directories on your hard drive, you can use the dir command.

To use the dir command:

  • Simply type “dir” and hit Enter. You will see a list of all of the files and folders in your current directory.
  • If you want to see more information about each file, such as the size or date created, you can type “dir /a” and hit Enter.

Tip: use “dir /?” to see a list of all of the options available for the dir command.

Why Can’t I Change Directory in CMD?

There are a few possible reasons why you might not be able to change directory in CMD.

  1. The first possibility is that you do not have administrator privileges. To fix this, try opening the Command Prompt as administrator. (see below on how to do this)
  2. Another possibility is that the directory you are trying to change to does not exist. Make sure you are typing the directory name correctly and that it is located on your hard drive.
  3. Finally, make sure you are using the correct syntax. The syntax for changing directory in CMD is “cd <directory name>”.

ALSO READ: Best Portable Monitor For Laptop | How to Choose

How To Change Directory in CMD As Administrator

If you want to change the directory in CMD as administrator, you will need to open the Command Prompt as administrator. Administrator privileges are an elevated level of permissions that allow you to make changes to your system that could potentially affect the stability of your computer.

To open the Command Prompt as administrator:

  1. Type “cmd” into the Start Menu search bar. Do not press Enter yet.
  2. Right-click on the Command Prompt entry and select “Run as administrator“.
  3. You will see a User Account Control pop-up asking if you want to allow the Command Prompt to make changes to your system. Click “Yes“.
Run CMD as Administrator
Run CMD as Administrator

You will now be in the administrator Command Prompt and you can change the directory as normal.

Keep in mind that you should only run the Command Prompt as administrator when absolutely necessary as it can potentially damage your system if used improperly.

How to Change Directories in CMD in Linux

Linux is based around the command line and uses the Terminal to enter commands. The Terminal is very similar to the Command Prompt in Windows and the two share many of the same commands.

  • To change directories in Linux, use the “cd” command. The syntax is similar to Windows: “cd <directory name>”.

For example, if you are in your home directory and want to change to the “Documents” directory, you would type “cd Documents” and hit Enter.

  • You can also use the “..” notation to move up one directory. For example, if you are in the “Documents” directory and want to move up to your home directory, you would type “cd ..”

You can also use this command to change directories in Linux. To do this, you would type in “cd /home/username/Documents” (replace username with your actual username). Remember, when using the cd command, always use lowercase letters.

FAQs How to Change Directories in CMD

What is the difference between the command prompt and a terminal?

The command prompt is a Windows-only program that allows you to execute commands on your computer. A terminal is a text-based interface that allows you to access a Unix-like operating system.
The command prompt is a specific instance of a terminal. In Windows, the command prompt is cmd.exe and in Linux, the terminal is bash.

How to exit the CMD screen?

To exit the CMD screen, simply type “exit” and hit Enter.

How to change directory in CMD to desktop?

To change directory in CMD to your desktop, you would type “cd Desktop” and hit Enter.

What is the difference between cd and dir?

The dir command lists all of the files and folders in your current directory while the cd command changes your current working directory.

What is Windows PowerShell?

PowerShell is a task automation and configuration management framework from Microsoft. It includes a command-line shell, object-oriented scripting language, and a set of tools for executing scripts/cmdlets and managing modules.

How do I change the directory in PowerShell?

To change the directory in PowerShell, you use the Set-Location cmdlet. For example, to change your home directory, you would type “Set-Location ~”.

How to Change Directories in CMD – Summary

Now you know how to change the directory as well as other commands using CMD in Windows and Linux. Remember to be careful when using the Command Prompt as administrator as it can potentially damage your system if used improperly.

JS Author Picture

J.S. is the owner, content creator, and editor at Upgrades-and-Options.com. I’ve worked in the IT and Computer Support field for over 20 years. The server hardware in my computer labs has mostly been IBM, but I’ve supported Dell, HP, and various other hardware. In addition, as part of my lab administrator responsibilities, I’ve learned, supported, and repaired/upgraded network hardware such as Cisco routers and switches. READ FULL BIO >>

  • How to Maximize Storage on Your Lenovo Laptop: Stop Wasting Space
    Are you struggling to manage the storage space on your Lenovo laptop? With digital files increasing in size and software requiring more room than before, efficiently utilizing the storage capacity of your Lenovo laptop is more important than ever. This blog post provides a straightforward approach to freeing up and optimizing your device’s storage space. By following a few simple steps, you can ensure that … Read more
  • How To Recover Deleted Files on Windows: Simple Steps for Novice Users
    Recovering deleted files on Windows is possible. Whether you’re a freelancer, a business owner, or a home user, this guide will help you navigate the file recovery process. From my own experience as a professional in the IT sector, I’ve seen countless scenarios where deleted files on Windows were successfully recovered, often with just a few simple steps. Whether you’re a freelancer juggling multiple projects, … Read more
  • Understanding RAM: A Guide to Choosing the Right RAM for Your Needs
    If you’re stepping into the vast universe of computer hardware, particularly interested in enhancing your system’s performance, you’re at the right place. Today, I want to demystify the concept of Random Access Memory (RAM) and guide you through selecting the perfect RAM for your needs. RAM plays a pivotal role in how swiftly your computer operates, impacting everything from software functionality to browsing efficiency. Thinking … Read more
  • Lenovo IdeaPad S340-14IIL RAM Upgrade (Do This)
    Looking to boost your Lenovo IdeaPad S340-14IIL’s performance? Upgrading its RAM is a great way to achieve that! This guide will walk you through the process, ensuring a smooth and successful upgrade. The good news is the S340 is capable of upgrading the RAM.This guide will be specifically for the Lenovo IdeaPad S340-14IIL. Other S340 models will be similar but might come with different amounts … Read more
  • Fix: Lenovo Keyboard Backlight Not Working
    Some users have reported issues with their Lenovo keyboard backlight not working properly. In this article, we will explore common reasons why this problem may occur and provide troubleshooting steps to help resolve it. Before We Begin: Many Lenovo laptops come configured with a backlit keyboard but not all, so it’s important to understand if your model does. In addition, the issue could be hardware … Read more