Results 1 to 3 of 3

Thread: Anybody know how to do this?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Location
    Atlanta
    Posts
    29

    Anybody know how to do this?

    I'm trying to write a VB program that will print out the drive or device name of a file, given the full path name. Assuming the device name is preceded by a colon and may be more than one character long. The user must know if there is no device name present.

  2. #2
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    umm not sure i follow you but something like this?

    MsgBox Left("C:\Windows\Desktop\MyFile.txt", 3)
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  3. #3
    Fanatic Member Slaine's Avatar
    Join Date
    Jul 2002
    Posts
    641
    Arc's example will only work the device name is only 1 char but :

    ...and may be more than one character long...
    So you could use

    split("C:\Windows\Desktop\MyFile.txt",":")(0)
    Martin J Wallace (Slaine)

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