The folder cannot be created since a file already exists with the same path

An attempt has been made to create a directory, but a file already exists with that path. This may be a result of incorrectly parsing paths, particularly when working with relative paths.

To correct this error

  • Check that you are supplying the correct path.

  • Remove the redundant file if it is no longer needed.

See Also

Tasks

How to: Create a Directory in Visual Basic

How to: Rename a Directory in Visual Basic

Reference

My.Computer.FileSystem Object

My.Computer.FileSystem.CreateDirectory Method

My.Computer.FileSystem.RenameDirectory Method

Other Resources

Creating, Deleting, and Moving Files and Directories in Visual Basic