Home » How to Create a New Directory in CMD

How to Create a New Directory in CMD

You can use the following syntax in Command Prompt (CMD) to create a new directory:

mkdir directory_name

This particular example will create a new directory with the specified name in the current directory.

Note: Ensure that the directory name you provide does not already exist, otherwise you will receive an error.

The following example shows how to use this syntax in practice.

Example: Creating a New Directory in CMD

Suppose that we want to create a new directory named my_app in the following path:

C:\Users\admin\Documents\cmd_script

We can type the following command to create the new directory:

mkdir C:\Users\admin\Documents\cmd_script\my_app

The following screenshot shows how to use this syntax in practice:

Make a directory in cmd
Make a directory in cmd

We can see that the new directory my_app has been created in C:\Users\admin\Documents\cmd_script.

Suppose we want to create a new directory in the current directory, we can run the following command:

mkdir my_app

The following screenshot shows how to use this syntax in practice:

Create a new directory in the current directory
Create a new directory in the current directory

We can see that the new directory my_app has been created in the current directory.

Conclusion

We can use the mkdir command followed by the path to create a new directory anywhere on the system.

You can find more topics about Active Directory tools and PowerShell basics on the ActiveDirectoryTools home page.