Make directory command windows

How to create a directory or 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 how to create 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’d like 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 the location of your choosing.
  3. In Windows 10 on the Home tab, click the New folder icon. In Windows 7 and earlier on the file menu bar, select File and then Folder.

In all versions of Windows, you can also right-click with your mouse on a blank portion of the folder, select New and then Folder.

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.

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 for information about creating a directory in the Windows command line.

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

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.

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

If you want to create a directory with spaces, you need to surround the directory name with quotes. In the example below, we are creating a directory called «my example directory» in the current directory.

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

Читайте также:  Alcohol 120 для windows 10 как пользоваться

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

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

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

Create a directory with a batch file

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

Creating a directory in Linux, Unix, and their variants

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

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.

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

If you want to change the permissions of a directory after its been 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’d like to place the new folder and on the top menu of File Manager, select File and then new folder.

MS-DOS

See the above MS-DOS user section 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’d like 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 .

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

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

Mkdir: Create directory from command line

In Windows, we can create directories from command line using the command mkdir(or md). Syntax of this command is explained below.

Create a folder from command line:

For example, to create a folder named ‘newfolder‘ the command is:

Create directory hierarchy

We can create multiple directories hierarchy(creating folder and sub folders with a single command) using mkdir command.
For example, the below command would create a new folder called ‘folder1’ and a sub folder ‘folder2’ and a sub sub folder ‘folder3’.

The above command is same as running the below sequence of commands.

Permissions issue

Yoou need to have permissions to create folder for the command to work. Not having permissions to create folder would throw up ‘access denied’ error.

If there exists a file or folder with the same name, the command throws up error.

If you don’t see a file or folder with that name, make sure to check if it’s not hidden.

Handling whitespaces

If the name needs to have space within, you should enclose it in double quotes.
For example, to create a folder with the name ‘My data’, the command would be

Читайте также:  Advanced linux sound architecture

Creating multiple folders

mkdir command can handle creating multiple folders in one go. So you can specify all the folders you wanted to create like below

The syntax of the command is incorrect.

If you get this error, make sure you are using the directory paths in Windows format and not in Linux format. On Linux, the directory paths are separated with ‘/’, but in Windows it’s ‘\’.

Create a Folder Using CMD in Windows

Not many Windows users are familiar with CMD. The common misconception is that only programmers and computer geeks use CMD. Basically, CMD is a tool that you can use to communicate with your Windows computer. Though the user interface and other input methods are introduced, CMD is one tool that you cannot take for granted. Some commands, such as creating folders, are easier to execute using CMD. You may laugh and think that it is harder to create a folder using CMD instead of using your mouse and the “Right click > New folder” method. You may have a point, but what if you are asked to create 10 folders or more? CMD would greatly simplify the task. Creating a folder using CMD is easy. This article will show you how.

Create a Folder Using CMD in Windows

To use CMD to create a folder on your Windows computer, follow these steps:

1. Click on the Search button located on the lower-left part of your computer’s screen.
2. In the Search box, type in CMD.
3. Open CMD from the results.
4. With CMD opened, go to the drive where you want to put the folder. To go to the drive, type in the name of the drive followed by the colon (:) symbol. In this case, we want to go to Drive D so we input D:.
5. CMD’s directory will change to the chosen drive. Type in the MKDIR command to create a directory or folder. In this case, we want to make a folder named TECHRECIPE, so we type in mkdir TECHRECIPE into CMD.
6. You are done. You can go to the newly created folder using CMD by typing in the command CD followed by name of the folder. In this case, type in CD TECHRECIPE in CMD.
7. You can also use your computer’s user interface to see that the folder has been created.

Create Multiple Folders Using CMD in Windows

To create multiple folders using CMD, follow these steps:

1. Open CMD on your Windows computer.
2. Go to the directory or folder where you want to create the multiple folders. In this case, we will go to the newly created folder.
3. Type in the MD command, followed by the names of the folders that you want to create. In this case, we want to create four folders named TR1, TR2, TR3 and TR4. Therefore, we input md TR1 TR2 TR3 TR4.
4. The subfolders will be created. You can go to the folder using your computer’s user interface, and you will see that all the subfolders have been created.
5. You are done.

Learning CMD is easy. If you want to know more about using CMD or if you have questions concerning any of the steps above, let us know in the comments section.

Make directory command windows

Make Directory — Create a new folder/directory.

The path can consist of any valid characters up to the maximum path length. Command extensions, which are enabled by default, allow a single MD command to create all the intermediate directories in a specified path.

Читайте также:  Библиотека реестра windows 10

Directories are one type of folder, namely, folders which correspond to file system locations. There are other types of folders, such as Control Panel or Network Neighborhood or Printers. These other types of folders represent objects in the shell namespace which do not correspond to files.

Naming Restrictions

The set of CMD delimiters (Comma , Semicolon ; Equals = Space ‘ ‘ Tab ‘ ‘) can be used in a folder name, but they must be enclosed in quotation marks:
MD «aa=bb» will create a folder called ‘aa=bb’,
MD aa=bb will create two folders ‘aa’ and ‘bb’

Try to avoid using the following characters in folder names, they may cause problems when scripting: © ® » & ‘ ^ @

The maximum length of a full pathname (folders + filename) is 260 characters, this is a limitation of Windows Explorer not NTFS.

You cannot create a folder with the same name as any of the following devices:
CON, PRN, LPT1, LPT2 ..LPT9, COM1, COM2 ..COM9
This limitation ensures that redirection to these devices will always work.

Errorlevels

If the Directory was successfully created %ERRORLEVEL% = 0
If the Directory could not be created %ERRORLEVEL% = 1

MKDIR is a synonym for MD

Make several directories with one command:

C:\temp\Alpha\
C:\temp\Beta\
C:\temp\Gamma\

Make an entire path
MD creates any intermediate directories in the path, if needed.
For example, assuming utils does not exist then:

for filenames with spaces or punctuation characters, add surrounding quotes:

MD «\utils\downloads\Super New Editor»

«We are American at puberty. We die French» — Evelyn Waugh

RD — Delete folders or entire folder trees.
MKLINK / Linkd — Link an NTFS directory to a target object.
powershell: New-Item -path c:\ -name «Demo Folder» -type directory.
What is the difference between a directory and a folder? — Raymond Chen.
Equivalent bash command (Linux): mkdir — Create new folder(s)

How to install and use “make” in Windows?

I’m following the instructions of someone whose repository I cloned to my machine. What I want is simple: to be able to use the make command as part of setting up the code environment. But I’m using Windows, and I searched online only to find a make.exe file to download, a make-4.1.tar.gz file to download (I don’t know what to do with it next), and things about downloading MinGW (for GNU; but after installing it I didn’t find any mention of «make»).

I don’t want a GNU compiler or related stuff; I only want to use «make» in Windows. Please tell me what I should do to accomplish that.

Thanks in advance!

10 Answers 10

make is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:

The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :

Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you’ll have a Linux distribution of your choice embedded in Windows 10 where you’ll be able to install make , gcc and all the tools you need to build C programs.

For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.

An outdated alternative was MinGw, but the project seems to be abandoned so it’s better to go for one of the previous choices.

Оцените статью