Need to extract File-name, Path and extn


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Need to extract File-name, Path and extn

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Need to extract File-name, Path and extn

    [Originally posted by Manish Vij]

    I have got a string Var (say d:\dataexch\pit\abc.dat.mv)
    I want to extract out File name, Path and Extension.
    What is the easiest possible way out?
    Thanks.

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Need to extract File-name, Path and extn

    [Originally posted by FreeVBCode.com]

    See the following:

    http://www.freevbcode.com/ShowCode.Asp?ID=2125
    http://www.freevbcode.com/ShowCode.Asp?ID=1638
    http://www.freevbcode.com/ShowCode.Asp?ID=794

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Need to extract File-name, Path and extn

    [Originally posted by Manish Vij]

    Thanks...

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Need to extract File-name, Path and extn

    [Originally posted by Gerson Ariel S]

    Hey, my name Gerson. And I'll help you something, but you just have to get your butt working sometimes!

    OK, here's the way. I'm just to bored yo type out the code... but this is the way. If you've Install VB6.0, it is mostly you have the Package and Deployment Wizard (right??). Ok, the folder for Package and Deployment Wizard something like this:
    "C:\Program Files\Microsoft Visual Studion\Visual Basic 6\PDWizard\"
    Ok, open the folder and search a project over there... VB Project, open it at you'll encounter the Setup code. Open the Module(s). Or something like Setup.bas, or maybe Common.bas. One of them contain a lot of string operation, such as what you requested... (And much more!!!!)

  5. #5
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Need to extract File-name, Path and extn

    [Originally posted by Renee]

    Check this out :

    dim a as new FileSystemObject

    fpath = "c:\Windows\Notepad.exe"

    path = a.GetDriveName(fpath)
    filename = a.GetFileName(fpath)
    Extn = a.GetExtensionName(fpath)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center