How to change directory in CMD (Command Prompt)

what to know

  • Type cd followed by a space, and then drag the folder or type the folder's name in Command Prompt.
  • Depending on the situation, you'll need to enclose the entire path in quotes.
  • If directory changes don't work, check that the syntax is correct.

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

It's much easier than you think. Here's an approach that requires very little input:

  1. Type cd and then press the space bar .

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

    cd C:UsersnameDownloads

  3. Press Enter to change the working directory to this folder.

If drag-and-drop isn't convenient or accessible (drag-and-drop doesn't work if you open an elevated Command Prompt), or you prefer to type commands, there are other ways to change folders in Command Prompt. Here are some examples:

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

    cd jonfi

    This relative folder naming only works for subfolders, which are directories immediately after or "below" the folder you're in.

  2. Alternatively, use backslashes to drill into multiple folders at once. For example, if you are working on the C drive, typing the following command will change directories to Jake's download folder:

    cd UsersJakeDownloads

  3. Enter cd.. to go up/back one directory. For example, if you are in the Desktop folder, entering this command will jump you back to the user's folder.

    If you feel lost in a directory, the dir command will list all the items contained in that folder.

  4. Enter cd to jump all the way to the root directory of the hard disk. In most cases, this is the C drive.

  5. If the folder is in a completely different location than the current path, you will need to enclose the entire path in quotes.

    For example, assume you are working in the C:Users folder. To access this folder (which is not part of the "user" path) you can enter the following:

    cd "C:Other computersMy PCGDRIVE NUCReceipts Bills etc"

If the working folder does not change in the command prompt, you may have done something wrong or the permissions are not set correctly. Here are some things to note that will make changing directories again simple.

  • Make sure you enter the correct command . Make sure to start the command by entering cd . You may have entered something incorrectly or entered too many characters. Make sure your grammar is accurate.
  • Check if the directory exists . If the folder you are trying to move to does not exist, your command will not work. Type dir to check the contents of the folder.
  • Check that you are browsing the correct hard drive . If you have multiple hard drives installed and need to jump to another hard drive, type X:, where X is the letter of the hard drive.
  • Confirm you have administrator rights . The cd command works in both standard and elevated command prompts, but other commands used with it may only run correctly when you use the command prompt as an administrator.
  • It is a command line interpreter program available on all Windows PCs. It is typically used to perform more advanced administrative functions or troubleshoot problems. The commands you can use depend on the version of Windows you have.

  • Type cls and press Enter. This will clear any previously entered commands.

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

  • Certain commands require an elevated command prompt to run. You'll know you need this feature if you get an error message about insufficient permissions or requiring administrator-level access. To elevate the command prompt, run it as administrator.