How to create a directory or folder

Updated: 12/05/2021 by Computer Hope
Folder

There are multiple ways to create or add a folder, subfolder, directory, and subdirectory on a computer. The methods depend on the operating system or where the directory is being created. Select a link below for steps on creating a directory and folder in each major operating system.

Creating a folder in Microsoft Windows

My Computer or Windows Explorer

  1. Open My Computer or Windows Explorer.
  2. Open the drive or folder where you want to create the new folder; for example, the C: drive. If you do not want to create a folder in the root directory, browse to your chosen location.
  3. In Windows 11, click the New option in the menu bar and select Folder in the drop-down menu.

    In Windows 8 and 10, on the Home tab, click the New folder icon.

    In Windows 7 and earlier, in the file menu bar, click File and select Folder in the drop-down menu.
Tip

In all versions of Windows, you can also right-click on a blank portion of the folder, select New, and then Folder in the drop-down menu.

Note

If you're using Windows 7 or earlier and do not see the file menu bar at the top of Windows Explorer, press the Alt key, and it should become visible.

New Windows Desktop folder

Windows desktop

  1. Navigate to the Windows desktop.
  2. Right-click any blank portion of the desktop.
  3. In the menu that appears (like that shown in the picture), click New and then Folder.
  4. A new folder appears. Type the name of the folder you want to use and then press Enter.

Create a new folder using a shortcut key

While in Windows Explorer, you can press Ctrl+Shift+N to create a new folder without using the mouse.

Windows command line

See the following MS-DOS and Windows command line user section to create a directory in the Windows command line.

Creating a directory in MS-DOS and the Windows command line

Tip

It is more appropriate to use "directory" instead of "folder" when referring to the command line.

To create a directory in MS-DOS or the Windows command line (cmd), use the md or mkdir MS-DOS command. For example, below, we are creating a new directory called "hope" in the current directory.

mkdir hope

You can also create multiple new directories in the current directory with the md command. In the following example, we are creating three new directories, called "user1," "user2," and "user3," in the current directory.

md user1 user2 user3

If you want to create a directory with spaces, you need to surround the directory name with quotes. In the example below, we create a "my example directory" in the current directory.

md "my example directory"

To create a directory in the parent directory without first moving to that directory, you can use the command below. This example moves back one directory to create the "example" directory.

md ..\example

To create a subdirectory in a different directory without moving to it, use a command similar to the example below. This command creates a "test" directory in the hope directory.

mkdir hope\test
Tip

Once a directory is created, you can use the cd command to change and move to that directory.

To make a directory in another drive without moving to that drive, use a similar command example to the example below. This command creates an "example" directory on the F: drive. The drive letter "f:" can be substituted for any drive letter.

md f:\example

Related information

Create a directory with a batch file

A batch file is a series of commands that are entered in the command line. Therefore, you can use any examples from the section above in the batch file to create a new folder.

Creating a directory in Linux, Unix, and their variants

Tip

It is more appropriate to use "directory" instead of "folder" when in a command line.

Note

You must have the permissions to create a directory outside of your home directory.

To create a directory in Linux, Unix, or any variant, use the mkdir Linux and Unix command. For example, below, we are creating a new directory called hope in the current directory.

mkdir hope
Tip

Once the directory is created, you can use the cd command to change and move to that directory.

Tip

If you want to change the permissions of a directory after it is created, use the chmod command.

Creating a folder and directory in Microsoft Windows 3.X

File Manager

  1. Open File Manager
  2. Open the folder where you want to place the new folder, and on the top menu of File Manager, select File and then the new folder.

MS-DOS

See the MS-DOS user section above for information about creating a directory in MS-DOS.

Creating a folder in macOS X

Desktop folder

  1. Navigate to the macOS desktop.
  2. Right-click (tap two fingers on the mouse) any blank space on the desktop.
  3. Select New Folder from the drop-down menu that appears.
  4. Name the folder and then press Return.

Create a folder in a directory

  1. Open Finder and navigate to the directory where you want to create the folder.
  2. Click File in the upper-left corner of the screen.
  3. Select New Folder in the drop-down menu that appears.
  4. Name the folder and then press Return.
Tip

Users may also press the shortcut key combination Command+Shift+N to create a new folder.

Tip

To create a directory in the Terminal command line, see the Linux steps.