FileSystem.RenameDirectory Method (String, String)
Renames a directory.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\).
newName contains path information.
directory is Nothing.
newName is Nothing or an empty string.
The directory does not exist.
There is an existing file or directory with the name specified in newName.
The path exceeds 248 characters.
A file or directory name in the path contains a colon (:) or is in an invalid format.
The user lacks necessary permissions to view the path.
The user does not have required permission.
This method cannot be used to move a directory; use the MoveDirectory method to move and rename the directory.
Available since 2.0