How to Change Directory in CMD: 3 Ways to Modify: Examples
Source: code.visualstudio.com

Tech news by email, once a week
Unsubscribe any time. Privacy policy
How do I change directories in Windows 10/11’s CMD (Command Prompt)? In Windows 10 or Windows 11, there are a few different ways to alter your CMD directory: To move to a new directory, open the Command prompt and type cd followed by the directory you want to go to.
To change the drive, type the drive letter followed by a colon at the Command prompt and press Enter. To use the GUI, type cd and a space at the command prompt, then drag the folder you wish to move into from File Explorer to the command prompt.
How to Change Directory in CMD
The Command Prompt, often known as cmd.exe, is a command-line interpreter in the Windows operating system that has been in use since the DOS days of Microsoft operating systems.
The command prompt, which is available as an alternative to the Windows GUI, provides significantly more flexibility and functionality to the common Windows user than the regular GUI ever could.
However, before you can do anything with the Command prompt, you must first understand how to change folders in it. We’ve discussed some of the simplest ways to update your Command prompt directory in Windows 10/11 in this article.
Let’s get started.
There are three ways to modify the directory of the Command Prompt.
On Windows 10/11, there are a variety of options for changing the Command Prompt directory. First, we’ll look at the cd command, which is arguably the most straightforward of them all. Let’s get started.
With the cd command, you can change the directory of your Command Prompt.
The cd command, which stands for Change Directory, allows you to easily move from one directory (folder) to another.
If you type cd on its own and press Enter, the Command prompt only prints the current directory. To jump to the root directory of the current drive, such as “C:\”, type cd \ and press Enter.
Simply type cd followed by the directory name to get to a certain location.
Example of How to Change Directory in Cmd
We went to the Downloads directory, which is located in the root directory of our Windows 10 installation.
You may need to surround the name in quotes for multiple word directories, such as cd “onenote notebooks” – one trick here is that you can start entering a directory name and then hit the tab key, and Windows will fill in the name for you. If you have many directories with similar names (for example, files 1, files 2, files 3, etc. ), keep using the tab key to cycle through the possibilities.
Alternatively, you can type cd .. to return to the parent folder. So, as we did with Windows 11, open your Command prompt, type cd .., and press Enter.
In the Command Prompt, change the drive
If you wish to change your drive, type the drive letter followed by a colon. So, if you’re now in the “C:” drive and want to switch to your “D:” drive, simply type “D:” at the Command prompt and press Enter. To change both the drive and the folder in one command, use cd /d, for example cd /d D:\Projects.
Another thing to remember is that the Command prompt is case-insensitive, which means it accepts both capital and lowercase letters. It doesn’t matter if you type “D:” or “d:”; the Command prompt will treat them both the same.
The dir command is another command that demands special attention. You’ll see a list of files and folders inside the current directory if you type dir in the Command prompt.
Now, if you want to get into a specific directory from here, simply use the cd command, followed by the directory’s name, like we did earlier.
By dragging the folder into CMD, you can change directories.
Here, you can use both the GUI and the Command prompt. In the Command prompt, type cd and a space, then drag the folder you want to move into onto the window and press Enter.
The command prompt will switch to the desired folder right away.
Using CMD to change folders (Command prompt)
If you want to become a Terminal pro, changing your terminal directory is only one of the numerous hacks you’ll learn along the road. When you go deeper into the Command prompt, you’ll learn a lot more.
Also Read:
Steps to Cancel Amazon Order Shipped: Return: Latest Updated
On Mobile Android, iPhone How to Change Instagram Password
Instagram Automatization: What Actions Can Be Automated
4 Ways to Enter Safe Mode Windows 10
FAQS:
Q1: In CMD, how can I change the directory to desktop?
When you launch a command prompt window, you are usually in your user folder (C:\Users\username). From there, type cd Desktop to get to the desktop. To get to the desktop from any other directory, type cd %USERPROFILE%\Desktop.
Q2: In CMD Mac, how can I change directories?
Macs use the Terminal app rather than CMD. In the Finder, you can open a different folder by double-clicking it. In Terminal, use the cd (change directory) command instead.
Q3: In a terminal, how can I change the directory?
The “cd” command can be used to change the current working directory (where “cd” stands for “change directory”). For example, you can type $ cd .. to move one directory higher (into the current folder’s parent folder).
Q4: In the Visual Studio terminal, how can I change the directory?
Open Visual Studio Code’s Command Palette (Ctrl+Shift+P on Windows and Linux, Cmd+Shift+P on Mac), start typing “shell command” and select Shell Command: Install ‘code’ command in PATH. After that, you may open a new terminal window, navigate to your project directory, and open the current directory in Visual Studio Code with code .
Get the week's tech news by email
One email a week with Trendblog's stories on AI, hardware, apps and crypto.
We'll email you to confirm your address. Unsubscribe any time. Privacy policy


