Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
FileSystem.CreateDirectory(String) Method
Definition
- Namespace:
- Microsoft.VisualBasic.FileIO
- Assembly:
- Microsoft.VisualBasic.Core.dll
- Assembly:
- Microsoft.VisualBasic.dll
- Source:
- FileSystem.vb
- Source:
- FileSystem.vb
- Source:
- FileSystem.vb
- Source:
- FileSystem.vb
- Source:
- FileSystem.vb
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a directory.
public:
static void CreateDirectory(System::String ^ directory);
public static void CreateDirectory(string directory);
static member CreateDirectory : string -> unit
Public Shared Sub CreateDirectory (directory As String)
Parameters
- directory
- String
Name and location of the directory.
Exceptions
The directory name is malformed. For example, it contains illegal characters or is only white space.
directory is Nothing or an empty string.
The directory name is too long.
The directory name is only a colon (:).
The parent directory of the directory to be created is read-only.
The user does not have permission to create the directory.
Examples
This example creates the directory, NewDirectory, in C:\Documents and Settings\All Users\Documents.
My.Computer.FileSystem.CreateDirectory(
"C:\Documents and Settings\All Users\Documents\NewDirectory")
Remarks
If the directory already exists, no exception is thrown.
The following table lists an example of a task involving the My.Computer.FileSystem.CreateDirectory method.
| To | See |
|---|---|
| Create a directory | How to: Create a Directory in Visual Basic |
Applies to
See also
Feedback
Was this page helpful?
