Export (0) Print
Expand All

MkDir Function

Creates a new directory or folder.

Public Sub MkDir(ByVal Path As String)

Parameter

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

Exceptions/Errors

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

Example

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.

Requirements

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

Show:
© 2014 Microsoft