How to Change Directory in cmd (Using Command Prompt)?

You know Windows Command Processor as Command Prompt. Sometimes you can tell it CMD commands, command shell, or even cmd prompt. However, whatever the name, you must use it through your commend. The graphical interface is famous to you, so you may face difficulty to commend on this interface. The most common problem is changing the directory. So I will show today how to change the directory in the command prompt.

What is Directory?

The computer directory is an organized file system. You may know it as a Folder. However, it is a collection of files to browse your files. The directory is no more a file but a combination of different files. It is a hierarchical file system to compare as a tree. You can open the directory from the graphical user interface or the command prompt. 

What is Command Prompt?

Command Prompt is a text-based computer interface to take command as input. This command-line interpreter program is helpful in all Windows operating systems. Popular cmd are Assoc, Cipher, Driverquery, File Compare, Ipconfig, Netstat, PathPing, etc. The following data from the cmd prompt will make your knowledge-rich.

Number Type Information
1. Initial release: December 1987; 34 years ago
1. Command Name: cmd.exe
2.  Interpreter Type: command-line interpreter
3. Developer(s) Name: Microsoft, IBM, ReactOS contributors
4.  Supported Operating system: Windows NT family, Windows CE family, OS/2, ReactOS, eComStation, and ArcaOS.
5. Predecessor Type: COMMAND.COM
6.  Alternative name: Windows Command Processor
7. Supported Platform: IA-32, x86-64, ARM
9. Popular Commands: Cd, call, cls, cmd, color, date, dir, echo, etc.

How to Open cmd Prompt?

If you are new, you may face problems in opening cmd prompt. However, it depends on the Windows OS version to version. Whatever the case, to open the cmd prompt, you can follow any options.How to open cmd prompt

  • You can open a Command Prompt in Admin Mode from Task Manager. I think it is the Secret and Easy Way for you.
  • Opening Cmd Prompt from a Start Menu Search is easier than you think. By scrolling through the Start Menu, you can easily open it.
  • With the help of File Explorer and File Explorer Address Bar, you can open it.
  • Run Box will be so easy to open your desired cmd prompt.
  • Finally, you Create a Shortcut for Command Prompt on the Desktop.

What Does the cmd Command do?

Cmd command can do many things as per your expectation. Windows has over 280 commands to perform a command-line interpreter. You can copy, paste, format, and backup your folder/file with the cmd command. Here are some helpful cmd commands for you:

Cd, call, cls, cmd, color, date, dir, echo, etc.

How To Change Directory In Command Prompt?

I will show you the easy way to change the directory of your cmd prompt. Type cd to see the present directory of your cmd prompt. You have to open it as an administrator.


If you want to open any file or folder, you have to drag and drop the file/folder on the black screen.


If you are comfortable typing, you can change the directory by command. Type cd then space and folder name which you want to find.

To go down two levels of documents at once: type cd name\name (for example cd Admin\Downloads)

To go back to one directory: type cd

Option If You Can’t Change The Directory

After typing your command, you may see that your command is not working. Then, don’t worry. Follow the following steps.

Wrong Typing: Most people face this common problem. If you can’t find your directory, check your folder’s spelling.

No directory: Sometimes, there may be no change in your directory. Then you have to check the existence of your directory. The spelling is also correct.

Multiple Hard Drive: If there are multiple hard drives on your computer, you may face a problem. So, check that you have browsed the correct one. Now, change the drive by typing X, where X is the directory’s name.

Administrative Permission: Despite having all the correct options, you may fail to change the directory. So, final check that you have run Cmd Prompt as Administrator.

How To Change Directory In Cmd To Desktop

The cd command allows you to change the directory to the immediate top of the tree. When you open your command prompt, it usually remains in the “C” drive. So, only the cd command will take to the desktop. If you are in another folder, you have to type cd (space) \docu~1\(username)\desktop. However, you can drag and drop your folder/file here.

How to Change the Directory to a Specific Folder?

You can change the directory of the command prompt to a specific folder. You can change it by typing and graphical methods if you want to go to a specific folder by typing the directory address (cd (space). For example, cd E:\Python\ppp. You have to type and ensure backslash.

You can go to a specific folder by a graphical interface. Type cd and drag & Drop the specific folder—finally, press Enter.

How do I change a directory from C to D in CMD?

You can change the directory from another directory by type and graphical method. If you want to type, then type cd D:\. You will find your desired directory. 

The other way is to type cd and drag & drop your folder. 

Copy and paste Method:

  1. Go to the directory from graphical representation and visit the folder.
  2. Copy your directory address and return to the command prompt from the address bar.
  3. Type cd and paste your copied text. You will see the changes.

How do I list drives in Command Prompt?

When you are at the cmd prompt screen, you can see all the drives of your directory with the dir command. If you need to see a detailed list of any specific directory, you have to type cd then directory name. Finally, type dir to see list drives in Command Prompt.

How do I use CMD?

You can do many things with the cmd command. If you are well conscious about your timing, then the cmd option is the best for you. For the slow-speed computer, the cmd option is a reliever. However, here are some essential commands to increase your productivity.

Shut Down 

Suppose you are downloading any important big file. Or you have to hand over the PC to your kid. You can assign time to shut down the computer with a command prompt. Type shutdown -s -t 3600 will shut down after one hour. You can change the seconds.How do I use CMD

Similarly, you may command for log out: shutdown -l -t 3600 and restart with r command. You also can cancel the command by typing shutdown -a.

Rename a Bunch of Files at Once:

Suppose you have captured a lot of pictures or videos. It is named built-in file systems, for example, Img-0001, Img-kt5, etc. To maintain the sequence, you can use the cmd prompt within 5 seconds. This Windows built-in program is convenient.

To rename any bunch of files, you have to visit the directory with the cd command. For example, cd E:\New folder (6) then type the command:

rename *.* ??????-original.*

Here the command rename will rename all the files of the directory. *.* is for all the files. You also can customize it here by prefix and suffix. ?????? means how many words you want to keep. Original means the previous files. You can also change the text.

View a Saved Wi-Fi Password

View a Saved Wi-Fi Password with command promptBesides knowing how to change the directory in cmd, the command prompt has many things to know. For example, you want to know the password of your connected WiFi. Then type “netsh wlan show profile WIFISSIDNAME key=clear”. Replace your WIFI SSID NAME with WIFISSIDNAME. You will see the details of your WiFi, including the password.

Format a Drive Cleanly

With only three quick steps, you can clean/format the drive you want from your PC. First of all, type list disk to see the list of your disk drive. Now type select disk diskname. Replace diskname with your directory. Finally, command “clean”. All the data of your directory will clean smoothly.

How Do I Create D Drive In The Command Prompt?

When you purchase a new PC, you may not have a D drive. However, using the cmd prompt command, you can easily create a D drive. Before doing the exercise, please take all the backups of your drive. It may lose your data. Let us start:

1. Run command prompt as administrator and command Diskpart.

2. Type list disk to see the available disk of your computer.

3. Select the desired disk by typing the name of the disk.

4. Clean the drive with the command: clean

5. Type “create partition primary” to make the drive again accessible.

6. Type “format fs=ntfs” to format the drive with FAT or NTFS file system

7. type “assign” to assign a drive letter.

Here, a new drive will be created. You can create more than one drive by following the system.

Can I install programs on the D drive with cmd?

You can install any program to any drive using cmd. So, you have to run the command prompt as administrator. Go to the directory you want to install the program, for example, D, by changing the directory with the cd command. Type D:Any_Folderany_program.exe and hit Enter

In reverse, you can uninstall any program with cmd. To uninstall, type “msiexec /x “ followed by the name of the “. msi” and press enter. “. msi” is the file used by the program that you want to remove.

Is PowerShell the Same as cmd?

Cmd is the default command of Windows. It is widely used for batch processing. On the other hand, PowerShell is the advanced version of cmd. Besides the easy interface, it also provides easy scripting language. You can do the same job of cmd with PowerShell. So, here are some differences between cmd and PowerShell.

Serial cmd PowerShell
1. Cmd was introduced in 1981 PowerShell was introduced in 2006
2.  You can open the program by typing cmd at run box. You can open the program by typing PowerShell at the run box.
3.  You are allowed to do batch commands. You are allowed for both like batch command and PowerShell command.
4.  You can not perform alises of cmd here. You can do it easily with a script.
5. Output is just a text. Output is an object.

How Do I Edit a File in cmd?

You can easily edit a file in cmd. Before editing a file, you have to run the cmd prompt as administrator. You can edit text files with the command edit. It is available on the 32-bit version of Windows. In the 64 bit version, you will not get it.

Which Command Will Create A New Directory In The Windows Environment?

You can create any directory to any existing directory. After running as administrator, type mkdir to your desired directory. You will see a new directory inside another directory.

Final Thought

I have started writing on How To Change Directory In Command Prompt? I have shown that, changing the directory in the command prompt is very easy. The commands are not case-sensitive. So you can type Cd, cD, or cd to change the present directory.

Hawlader's passion for technology has driven him to be an avid writer for over 16 years. His vast knowledge of the Windows and Android operating systems is a testament to his proficiency in the field. In addition to his expertise in open source software, he also possesses an extensive understanding of the open-source platform, making him a valuable resource for technology enthusiasts. His contributions to FossGuru writers with research-based articles have helped readers to stay up-to-date with the latest trends in the tech industry. Furthermore, Hawlader's curiosity for scientific breakthroughs has led him to be a keen reader of science blogs, keeping him informed about the latest developments in the field.

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles