How to Change Directories in CMD (Command Prompt) (2024)

> Windows

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

By

Jennifer Allen

How to Change Directories in CMD (Command Prompt) (1)

Jennifer Allen

Writer

  • Swansea University, Staffordshire University

Jennifer Allen has been writing about technology since 2010. Her work has appeared in Mashable, TechRadar, and many more publications.

lifewire's editorial guidelines

Updated on May 30, 2024

Reviewed by

Jon Fisher

How to Change Directories in CMD (Command Prompt) (2)

  • Wichita Technical Institute

Jonathan Fisher is a CompTIA-certified technologist with more than 10 years of experience writing for publications like TechNorms and Help Desk Geek.

lifewire's editorial guidelines

In This Article

View All

In This Article

  • Step-by-Step: Drag and Drop the Folder
  • More Ways to Navigate Folders
  • Tips to Remember
  • Frequently Asked Questions

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 circ*mstance, 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:

     cdC:\Users\name\Downloads

    How to Change Directories in CMD (Command Prompt) (3)

  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:

21 Best Command Prompt Tricks
  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:

     cdjonfi

    How to Change Directories in CMD (Command Prompt) (4)

    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:

     cdUsers\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.

    How to Change Directories in CMD (Command Prompt) (5)

    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:\Othercomputers\MyPC\GDRIVENUC\ReceiptsBillsetc"
How to Open Command Prompt in a Folder

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?

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Subscribe

Tell us why!

How to Change Directories in CMD (Command Prompt) (2024)

FAQs

How to Change Directories in CMD (Command Prompt)? ›

To change current working directory under the current drive, use command " cd

cd
The cd command, also known as chdir (change directory), is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.
https://en.wikipedia.org › wiki › Cd_(command)
new-path " (change directory). It is important to take note that you need to set the current drive first (via " x: " command) before setting the current directory under the current drive.

How do you change directories in cmd? ›

Type 'cd' and Space: To tell Command Prompt you want to change the folder, type `cd` (which stands for “change directory”) followed by a space. Enter the Folder Name: Now, type the name of the folder you want to go to. If your folder name has spaces, put it in double-quotes.

How do I move a directory up in cmd? ›

To go up one level of the directory tree, type the following: cd .. The special file name, dot dot ( .. ), refers to the directory immediately above the current directory, its parent directory.

What is the CD command in cmd? ›

'cd' in CMD stands for Change directory. This command is used for navigating between directories in the Command Prompt.

How to set path in cmd? ›

Windows
  1. In Search, search for and then select: System (Control Panel)
  2. Click the Advanced system settings link.
  3. Click Environment Variables. ...
  4. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. ...
  5. Reopen Command prompt window, and run your java code.

What command is used to change directories? ›

The cd command, also known as chdir (change directory), is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.

How to set current directory in CMD? ›

The current directory can be set using the CD command, CD. The CD command has a similar format to the cd command in operating systems such as DOS. The syntax is CD followed by the partially or fully qualified directory name. To change from a subdirectory back to the parent directory, type CD .. .

How do I move to a specific directory? ›

Right-click on the directory and choose the "Cut" or "Move" option from the context menu and navigate to the destination directory where you want to move the selected directory.

What is the command to move a directory? ›

The mv command moves files and directories from one directory to another or renames a file or directory. If you move a file or directory to a new directory, it retains the base file name.

What is the move command in cmd? ›

In computing, move is a command in various command-line interpreters (shells) such as COMMAND.COM , cmd.exe , 4DOS/4NT, and PowerShell. It is used to move one or more files or directories from one place to another.

How do I change the directory in terminal? ›

The cd command allows you to move between directories. The cd command takes an argument, usually the name of the folder you want to move to, so the full command is cd your-directory . Now that we moved to your Desktop, you can type ls again, then cd into it. We have just changed into a new directory.

How do I go to a folder in CMD? ›

Type "cd" followed by a space, but do not press Enter just yet. Type the address of the folder after the space and press ↵ Enter . You'll need to include every folder and sub-folder the folder is located in. Place a backslash ("\") in front of each folder name.

How to back directory in cmd? ›

Type. cd.. into the prompt. After you press Enter, this command tells the program to navigate back to the previous folder. It's important you type the two dots, since you won't navigate anywhere if you simply type “cd” into the prompt.

How to change folders in cmd? ›

Open the Command Prompt (CMD) and type "cd" with a space, followed by the name of the directory, or drag and drop the directory into CMD from File Explorer. Press "Enter."

How do I go to a different path in CMD? ›

How Do I Change Directories in Command Prompt?
  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.
  3. Press Enter to change the working directory to that folder.
May 30, 2024

How to call a path in cmd? ›

Follow these four steps to run a file in command prompt:
  1. Open command prompt. There are several ways to open the command prompt app. ...
  2. Open the file pathway. To open the correct file, direct the command prompt app to the correct file path in your Windows by using this command template: cd [file path]. ...
  3. Execute the file.
Jul 2, 2024

How to change git directory in CMD? ›

To change this current working directory, you can use the "cd" command (where "cd" stands for "change directory"). For example, to move one directory upwards (into the current folder's parent folder), you can just call: $ cd ..

How to change root directory in CMD? ›

Open Command Prompt in Windows 10

In the power user task menu, select Command Prompt (Admin) (Figure 8). This opens the Command Prompt window (Figure 9). To change to the Root directory type cd\ and press Enter (Figure 10). NOTE: The Root directory is the best place to enter any required commands or instructions.

How to change directory to program files in CMD? ›

Then you can type CD command lines in CMD to change different directory or folder paths. If you want to go to a specific directory, you can type cd + full directory path, e.g. cd C:\Program Files. To open a particular folder, you can type cd + full folder path, e.g., cd C:\Program Files\office.

How to navigate to a file in CMD? ›

The "dir" command followed by a search term allows you to find files and view their file paths. To open a file, navigate to its directory using the "cd" command and enter the file name into Command Prompt. If the path or filename have spaces, put quotation marks around them.

Top Articles
What is Absorption Costing?
ISP Tracking: What is it and How to Prevent it | IPVanish
Maxtrack Live
Kevin Cox Picks
7 Verification of Employment Letter Templates - HR University
Ups Dropoff Location Near Me
Week 2 Defense (DEF) Streamers, Starters & Rankings: 2024 Fantasy Tiers, Rankings
Restaurer Triple Vitrage
Lamb Funeral Home Obituaries Columbus Ga
Kaydengodly
New Slayer Boss - The Araxyte
America Cuevas Desnuda
Kristine Leahy Spouse
Jonathan Freeman : "Double homicide in Rowan County leads to arrest" - Bgrnd Search
J Prince Steps Over Takeoff
Walgreens On Nacogdoches And O'connor
What Was D-Day Weegy
Housework 2 Jab
How Much Is Tj Maxx Starting Pay
Luna Lola: The Moon Wolf book by Park Kara
Google Flights Missoula
Marine Forecast Sandy Hook To Manasquan Inlet
Universal Stone Llc - Slab Warehouse & Fabrication
Laveen Modern Dentistry And Orthodontics Laveen Village Az
‘The Boogeyman’ Review: A Minor But Effectively Nerve-Jangling Stephen King Adaptation
Craigslist St. Cloud Minnesota
Ontdek Pearson support voor digitaal testen en scoren
TJ Maxx‘s Top 12 Competitors: An Expert Analysis - Marketing Scoop
Craigslist Boerne Tx
Lawrence Ks Police Scanner
Craigslist Central Il
Mg Char Grill
Kokomo Mugshots Busted
Lowell Car Accident Lawyer Kiley Law Group
Uhaul Park Merced
آدرس جدید بند موویز
Jennifer Reimold Ex Husband Scott Porter
Agematch Com Member Login
Asian Grocery Williamsburg Va
42 Manufacturing jobs in Grayling
Daily Jail Count - Harrison County Sheriff's Office - Mississippi
8005607994
Walgreens Agrees to Pay $106.8M to Resolve Allegations It Billed the Government for Prescriptions Never Dispensed
Red Dead Redemption 2 Legendary Fish Locations Guide (“A Fisher of Fish”)
Final Fantasy 7 Remake Nexus
Todd Gutner Salary
Sea Guini Dress Code
Graduation Requirements
What your eye doctor knows about your health
Marion City Wide Garage Sale 2023
Shad Base Elevator
Latest Posts
Article information

Author: Rob Wisoky

Last Updated:

Views: 5633

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Rob Wisoky

Birthday: 1994-09-30

Address: 5789 Michel Vista, West Domenic, OR 80464-9452

Phone: +97313824072371

Job: Education Orchestrator

Hobby: Lockpicking, Crocheting, Baton twirling, Video gaming, Jogging, Whittling, Model building

Introduction: My name is Rob Wisoky, I am a smiling, helpful, encouraging, zealous, energetic, faithful, fantastic person who loves writing and wants to share my knowledge and understanding with you.