FileSystem.MkDir Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a new directory. The My feature gives you better productivity and performance in file I/O operations than MkDir. For more information, see CreateDirectory.

Namespace:   Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public static void MkDir(
	string Path
)

Parameters

Path
Type: System.String

Required. String expression that identifies the directory to be created. The Path may include the drive. If no drive is specified, MkDir creates the new directory on the current drive.

Exception Condition
ArgumentException

Path is not specified or is empty.

SecurityException

Permission denied.

IOException

Directory already exists.

This function creates a new directory.

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

' Make new directory.
MkDir("C:\TESTDIR")

.NET Framework
Available since 1.1
Return to top
Show: