Windows

How to change directory in CMD on Windows 10

All problems related to Windows can be resolved using a program called Command Prompt (CMD). You can feed the Command Prompt with executable commands to perform various administrative functions. For example, the cd or change directory command is used to change the path of the directory where you are currently working. For example, the cd windows system32 command will switch the directory path to the System32 subfolder within the Windows folder. The Windows cd command is also called chdir, and it can be used in both shell scripts and batch files. In this article, you will learn how to change the directory in CMD on Windows 10.

How to Change Directory in CMD on Windows 10 How to Change Directory in CMD on Windows 10

How to change directory in CMD on Windows 10

What is Windows CWD and CD Command?

The current working directory abbreviated as CWD is the path where the shell is currently running. CWD is mandatory to keep its relative tracks. Your operating system’s command interpreter carries a generic command called the cd Windows command.

Type the command cd /? In the Command Prompt window to display the name of the current directory or changes to the current directory. After entering the command, you will get the following information in Command Prompt (CMD).

CHDIR [/D] [drive:][path]
CHDIR [..]
CD [/D] [drive:][path]
CD [..]
  • This.. specifies that you want to change to the parent directory.
  • Type cd drive: to display the current directory in the specified drive.
  • Write CD without parameters to display the current drive and directory.
  • Use the /D switch to change the current drive, as well as change the current directory of the drive.

type the command cd in the command prompt window - How to change directory in CMD on Windows 10

In addition to the Command Prompt, Windows users can also use PowerShell to execute various commands as explained by the Microsoft docs here.

What happens when command extensions are enabled?

If command extensions are enabled, CHDIR changes as follows:

  • The current directory string is converted to use the same case as the names on the disk. So, CD C:TEMP actually sets the current directory to C:Temp if this is the case on the disk.
  • The CHDIR command does not treat spaces as delimiters, so it is possible to use cd in a subdirectory name that contains a space even without enclosed in quotation marks.

For example: command: cd winnt profiles username Programs start menu

It is the same command: cd “winntprofilesusernameProgramsstart menu”

Read on below to modify/switch to directories or to a different file path.

Method 1: Change directory by path

Use the cd + full directory path command to access a specific directory or folder. No matter what directory you are in, this will take you directly to the desired folder or directory. Follow the given steps to do this:

1. Open Directory or folder that you want to navigate in CMD.

2. Right-click on the address bar and select Copy Address, as shown.

right click on the address bar and then select cop - How to change directory in CMD on Windows 10

3. Now, tap on Windows key , And type cmd , and press Enter To start the command prompt.

press windows key type cmd and hit enter 1 - How to change directory in CMD on Windows 10

4. In CMD, type cd (the path you copied) and hit Enter as shown.

in cmd type cd the path you copied and press en - How to change directory in CMD on Windows 10

This will open the directory you copied in a command prompt.

Method 2: Change Directory by Name

Another way how to change directory in CMD Windows 10 is to use cd command to run the directory level where you are currently working:

1. Open Command Prompt as described in Method 1.

2. Type cd (the directory you want to go to) and press Enter.

Note: add the directory name using the cd command to navigate to that respective directory. eg desktop

change directory by directory name in command prompt cmd 2 1024x568 1 - How to change directory in CMD on Windows 10

Method 3: Go to the father’s directory

When you want to go to a single folder, use the cd command… Here’s how to change the parent directory in CMD on Windows 10.

1. Open Command Prompt As previously.

2. Type cd …and press ENTER.

Note: Here, you will be redirected from system folder to public files folder.

type cd and press enter key - How to change directory in CMD on Windows 10

Method 4: Go to the root directory

There are several commands to change the directory in CMD Windows 10. One of these commands is to change to the root directory:

Note: You can access the root directory no matter what directory you belong to.

1. Open Command Prompt , And type cd / , and press Enter.

2. Here, the root directory of the program files is drive C, where the command cd / took you.

use the command cd to access the root director - How to change directory in CMD on Windows 10

Method 5: Change the drive

This is one of the easiest ways on how to change the directory in CMD on Windows 10. If you want to change the drive in CMD, you can do so by typing a simple command. Follow the steps listed below to do so.

1. Go to Command Prompt As described in the first method.

2. Type the drive letter followed by: (colon) to access another drive and press the Enter key.

Note: Here, we are changing from drive C: to drive D: and then to drive E:

type the drive letter followed by to access an - How to change directory in CMD on Windows 10

Method 6: Change motor and guide together

If you want to change the drive and directory together, there is a certain command to do so.

1. Go to Command Prompt As mentioned in the first method.

2. Type the command cd / To access the root directory.

3. Add the drive letter followed by: (colon) to start the target drive.

For example, type cd / DD: Photoshop CC and hit the Enter key to move from the C: drive to the Photoshop CC directory in the D drive.

type the drive letter followed by to launch th - How to change directory in CMD on Windows 10

Method 7: Open the directory from the address bar

Here’s how to change the directory in CMD on Windows 10 directly from the address bar:

1. Click on the address bar of the directory you want to open.

click on the address bar of the directory - How to change directory in CMD on Windows 10

2. Type cmd and press the . key Enter , As shown.

Write cmd and press enter key - How to change directory in CMD on Windows 10

3. The selected directory will open in Command Prompt.

word image 32 - How to change directory in CMD on Windows 10

Method 8: View inside the directory

You can also use commands to display within the directory, as follows:

1. in Command Prompt , use the command dir Displays subfolders and subdirectories in your current directory.

2. Here, we can see all the directories inside C:Program Files folder.

We hope this guide was helpful and you were able to change the directory in CMD Windows 10. Tell us which cd command you think Windows is more useful. Also, if you have any queries or suggestions regarding this article, feel free to leave them in the comments section.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker