Results 1 to 3 of 3

Thread: Simple Dir Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344
    Ok, in a dos environment if i wanted to find a file that begins with car and doesn't really matter what the file extension is i would type. Dir/s c:\car.*...now i want to do something similar in vb but don't know any wild card...ex

    If Dir$(\book\car) <> "" Then
    msgbox "I want it to find any file that has car but no extension"
    elseif
    msgbox "but instead it finds the car file but if the file is car.12 and i look for "car" it doesnt find it..so need to get that code to look for car.*..got me?)
    end if
    -RaY
    VB .Net 2010 (Ultimate)

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Code:
    If Dir$("\boo\car.*") <> "" Then
      'At least 1 file exists
    End if
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Oh

    I thought * is used as a operator, not a wild card. Got a little confused there, but thanks.
    -RaY
    VB .Net 2010 (Ultimate)

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