Results 1 to 3 of 3

Thread: Check Folder Exist

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    1

    Check Folder Exist

    Hi All,

    I using VB .Net. I would to check whether this folder exist in my hard disk or not.

    Please Help.

    Regards,
    Dennis

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    I believe this is what you're looking for...
    VB Code:
    1. If IO.Directory.Exists(Path)=True Then
    2.     'Do something
    3. End If
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  3. #3
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    damn pax! u got there before me. I saw this post earlier, but didn't have time to reply.

    dennist, his method works. if ur unsure, heres another example with full code

    VB Code:
    1. '  Checking whether the directory exists in the specified path
    2.    Dim strMyPath as String = "C:\mySample"
    3.  
    4.    If Directory.Exists(strMyPath) = True then
    5.          MsgBox("Directory exists!")
    6.    Else
    7.          MsgBox("Directory does not exist")
    8.    End if

    hope it helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width