Home
» Wiki
»
How to Change Directory in CMD on Windows 10
How to Change Directory in CMD on Windows 10
All Windows-related issues might be solved with a program named 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 directory path where you are working currently. For instance, the command cd\windows\system32 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 employed in both, shell scripts and batch files. In this article, you will learn how to change the directory in CMD on Windows 10.
The Current Working Directory abbreviated as CWD is the path where the shell is currently working. The CWD is mandatory to retain its relative paths. The command interpreter of your Operating System holds a generic command called cd command Windows.
Type the command cd /? in the Command Prompt window to display the name of the current directory or changes in the current directory. After entering the command you will get the following information in Command Prompt (CMD).
If Command Extensions are enabled, CHDIR changes as follows:
The current directory string is converted to use the same case as the on-disk names. So, CD C:\TEMP would actually set the current directory to C:\Temp if that is the case on disk.
CHDIR command does not treat spaces as delimiters, so it is possible to use CD into a subdirectory name that contains a space even without surrounding it with quotes.
For example: command: cd \winnt\profiles\username\programs\start menu
is same as the command: cd “\winnt\profiles\username\programs\start menu”
Continue reading below to modify/switch to the directories or to a different file path.
Method 1: Change Directory By Path
Use the command cd + full directory path to access a specific directory or folder. Regardless of which directory you are in, this would take you straight to the desired folder or directory. Follow the given steps to do so:
1. Open the directory or folder which you want to navigate in CMD.
2. Right-click on the address bar and then select Copy address, as shown.
3. Now, press the Windows key, type cmd, and hit Enter to launch Command Prompt.
4. In CMD, type cd (the path you copied) and press Enter as depicted.
This will open the directory which path you copied in Command Prompt.
Method 2: Change Directory By Name
Another way for how to change the directory in CMD Windows 10 is to use the cd command to launch a directory level where you are currently working:
1. Open Command Prompt as shown in Method 1.
2. Type cd (directory you want to go to) and hit Enter.
Note: Add the directory name with the cd command to go to that respective directory. e.g. Desktop
This is one of the easiest methods on how to change the directory in CMD on Windows 10. If you want to change the drive in CMD then, you can do so by typing a simple command. Follow the steps listed below to do so.
1. Go to Command Prompt as instructed in Method 1.
2. Type the drive letter followed by : (colon) to access another drive and press Enter key.
Note: Here, we are changing from drive C: to drive D: and then, to drive E:
Method 6: Change Drive & Directory Together
If you want to change the drive and directory together then, there is a particular command to do so.
1. Navigate to Command Prompt as mentioned in Method 1.
2. Type the cd / command to access the root directory.
3. Add the drive letter followed by : (colon) to launch the target drive.
For Example, type cd /D D:\Photoshop CC and press Enter key to go from drive C: to Photoshop CC directory in D drive.
We hope this guide was helpful and you were able to change the directory in CMD Windows 10. Let us know which cd command Windows do you think is more useful. Also, if you have any queries or suggestions regarding this article, then feel free to drop them in the comments section.