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.
- 1 How to change directory in CMD on Windows 10
- 2 What happens when command extensions are enabled?
- 2.1 Method 1: Change directory by path
- 2.2 Method 2: Change Directory by Name
- 2.3 Method 3: Go to the father’s directory
- 2.4 Method 4: Go to the root directory
- 2.5 Method 5: Change the drive
- 2.6 Method 6: Change motor and guide together
- 2.7 Method 7: Open the directory from the address bar
- 2.8 Method 8: View inside the directory
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.
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.
3. Now, tap on Windows key , And type cmd , and press Enter To start the command prompt.
4. In CMD, type cd (the path you copied) and hit Enter as shown.
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
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.
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.
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:
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.
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.
2. Type cmd and press the . key Enter , As shown.
3. The selected directory will open in Command Prompt.
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.