# MkDir
{: .no_toc }

Creates a new directory or folder.

Syntax: **MkDir** *path*

*path*
: A string expression that identifies the directory or folder to be created. The *path* may include the drive. If no drive is specified, **MkDir** creates the new directory or folder on the current drive.

### Common Errors

| Error | When |
|---|---|
| [-2147467259 (`&H80004005`)](/Reference/Run-time-Errors.md#-2147467259), *Unspecified error* | *path* already exists, as a folder or as a file<br>the folder or drive that would hold *path* does not exist, or *path* is a zero-length string or a name a folder cannot have |
| [94 (`&H5E`)](/Reference/Run-time-Errors.md#94), *Invalid use of Null* | *path* is **Null** |

> [!NOTE] BETA 1045
> When *path* already exists, as a folder or as a file, VB6 and 64-bit VBA raise error [75 (`&H4B`)](/Reference/Run-time-Errors.md#75), *Path/File access error*, instead.

> [!NOTE] BETA 1045
> When the folder or drive that would hold *path* does not exist, or *path* is a zero-length string or a name a folder cannot have, VB6 and 64-bit VBA raise error [76 (`&H4C`)](/Reference/Run-time-Errors.md#76), *Path not found*, instead.

### See Also

- [ChDir](/tB/Modules/FileSystem/ChDir.md), [ChDrive](/tB/Modules/FileSystem/ChDrive.md), [RmDir](/tB/Modules/FileSystem/RmDir.md) statements
- [CurDir](/tB/Modules/FileSystem/CurDir.md), [Dir](/tB/Modules/FileSystem/Dir.md) functions

### Example

This example uses the **MkDir** statement to create a directory or folder. If the drive is not specified, the new directory or folder is created on the current drive.

```tb check_build
MkDir "MYDIR"   ' Make new directory or folder.
```
