This documentation is archived and is not being maintained.

MkDir Function

Creates a new directory or folder.

Public Sub MkDir(ByVal Path As String)


Required. 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.


Exception type Error number Condition
ArgumentException 52 Path is not specified or is empty.
IOException 75 Directory already exists.


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

MkDir("C:\MYDIR")   ' Make new directory or folder.

Smart Device Developer Notes

This function is not supported.


Namespace: Microsoft.VisualBasic

Module: FileSystem

Assembly: Microsoft Visual Basic .NET Runtime (in MicrosoftVisualBasic.dll)

See Also

ChDir Function | CurDir Function | RmDir Function | ArgumentException Class| IOException Class