Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if Folder Exists 1

Status
Not open for further replies.

AccordingToDale

Programmer
Jul 11, 2005
128
CA
Howdy,

I know this is not all that complicated, but experiencing a bit of brain fade today...

How do I check if a folder exists, and if not then create it?

Dale
 
Code:
if not system.IO.Directory.Exists(path)then
  system.IO.Directory.CreateDirectory(path)
end if

But I think you can skip the check and just try to make it, if it already exists, the folder is not created or overwriten.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top