How to: Determine if a Directory Exists in Visual Basic
You can use theto determine whether or not a specified directory exists.
The call to DirectoryExists requires.
This method throws no exceptions.
The options available in dialog boxes, and the names and locations of menu commands you see, might differ from what is described in Help, depending on your active settings or edition. This Help page was written with General Development Settings in mind. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see.
To determine if a directory exists
Use the My.Computer.FileSystem.DirectoryExists method, supplying the path, to determine whether or not the specified directory exists. The following example checks to determine whether or not the directory C:\backup\logs exists and checks its properties.