Tag Archives: folder exists

Check if a Specified File or Directory Exists in VB 2008/2010 and Newer

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.60 out of 5)
 

Shows how to use Visual Basic.NET 2005/2008/2010 and Higher to check if a file and if a folder or directory exists or not.

MsgBox(My.Computer.FileSystem.FileExists("c:\theFile.txt"))
MsgBox(My.Computer.FileSystem.DirectoryExists("c:\"))