1 out of 2 rated this helpful - Rate this topic

How to: Create a Directory in Visual Basic

Use the CreateDirectory method of the My.Computer.FileSystem object to create directories.

If the directory already exists, no exception is thrown.

To create a directory

  • Use the CreateDirectory method by specifying the full path of the location where the directory should be created. 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")
    

The following conditions may cause an exception:

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.