How to Change Directories in CMD (Command Prompt)

Type cd and then write the full folder path. Don't forget quotes (in some cases)

What to Know

  • Type cd followed by a space, then drag the folder or type the name of the folder into Command Prompt.
  • Depending on the circumstance, you'll need to surround the whole path in quotes.
  • Check that your syntax is correct if directory changes don't work.

This article explains several ways you can switch to a different directory while working in the Windows 11 or Windows 10 Command Prompt. It also teaches you what to do if these directions don't work.

How Do I Change Directories in Command Prompt?

It's a lot easier than you think. Here's one method that requires very little typing:

  1. Type cd and then press Space.

  2. Drag and drop the folder you want to browse into the window. For example, if we drag the Downloads folder, the prompt might say this:

     cd C:\Users\name\Downloads
    
    The CD command typed into Command Prompt with a folder path dragged into it
  3. Press Enter to change the working directory to that folder.

How Do I Navigate to a Folder in Command Prompt?

If drag and drop isn't convenient or accessible (it doesn't work if you opened an elevated Command Prompt), or you'd prefer to type your commands, there are other ways to change the folder in Command Prompt. Here are a few examples:

  1. Type cd followed by a space, then type the folder's name. In this example, the change directory command switches from the Users folder to the jonfi folder:

     cd jonfi
    
    The CD command in Command Prompt

    This relative way of naming the folder only works for subfolders, i.e., directories straight after, or "under" the one you're in.

  2. Alternatively, use a backslash to drill through multiple folders at once. For example, if you're working from the C drive, typing this command will change the directory to Jake's Downloads folder:

     cd Users\Jake\Downloads
    
  3. Type cd.. to go up/back one directory. If you're in the Desktop folder, for instance, entering this command will jump you back to the user's folder.

    The cd.. command in Command Prompt

    If you feel lost within the directory, the dir command lists all the items contained in that folder.

  4. Type cd\ to jump all the way to the root of the hard drive. In most cases, this is the C drive.

  5. If the folder is somewhere totally different from where the current path is, you'll need to surround the whole path in quotes.

    For instance, assume you're working in the C:\Users folder. To get to this folder, which isn't part of the "Users" path, you'd type this:

     cd "C:\Other computers\My PC\GDRIVE NUC\Receipts Bills etc"
    

Why Can't I Change Directory in CMD? 

If the working folder doesn't change in Command Prompt, you may be doing something wrong or have your permissions set incorrectly. Below are some things to be mindful of that should make it simple to change directories again.

  • Ensure you're typing the correct command. Make sure to start your command by typing cd. You may have mistyped something or typed too many characters. Be sure you're accurate in your syntax usage. 
  • Check the directory exists. If the folder you're trying to move to doesn't exist, then your command won't work. Type dir to check the contents of a folder. 
  • Check you're browsing the correct hard drive. If you have multiple hard drives installed and you need to jump to a different one, type X: where X is the letter of the hard drive.
  • Confirm that you have admin rights. The cd command works in the standard and elevated Command Prompt, but other commands you're using with it might only run correctly if you're using Command Prompt as an administrator.
FAQ
  • What is Command Prompt?

    It's a command-line interpreter program that's available on all Windows PCs. It's often used to perform more advanced administrative functions or to troubleshoot an issue. The commands you can use depend on which version of Windows you own.

  • How do you clear Command Prompt?

    Type cls and press Enter. This clears all of the previous commands you entered.

  • Can I use copy/paste in Command Prompt?

    Yes, but you need to enable it first in some versions of Command Prompt. Open the program, right-click on the top bar, and select Properties. Under Edit Options, select the checkbox next to Use Ctrl+Shift+C/V as Copy/Paste.

  • What is an elevated command prompt?

    Specific commands require an elevated Command Prompt to run. You'll know you need this if you get an error message about having insufficient privileges or needing administrator-level access. To elevate Command Prompt, run it as an administrator.

Was this page helpful?