• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1496
  • Last Modified:

vb6 get file from path

hello,
I am using VB6. i have a string that contains a path + file name.
such as c:\temp\some folder\myFile.zip.
what is the best way to get the myFile.zip?

thanks
0
XK8ER
Asked:
XK8ER
  • 2
1 Solution
 
game-masterCommented:

good morning!
u can use the file system object..

try this approach....

Public FSO As New FileSystemObject

FSO.getFile "c:\temp\some folder\myFile.zip"

then you will get the file "myFile.zip"



i hope i can give u some idea...

game-master
0
 
XK8ERAuthor Commented:
im trying this but its not working!

lblFile.Caption = FSO.GetFile("c:\temp\some folder\myFile.zip")
0
 
game-masterCommented:

are u trying the put the name of the file to the label caption?

this is the way to do it...

dim myFile as File

myFile = FSO.getFile "c:\temp\some folder\myFile.zip"
lblFile.Caption = myFile.Name

*** if u want to know other information about the file, just select when you type the " . " after the myFile


i hope i can give u idea.

game-master
0
 
Patrick MatthewsCommented:
Debug.Print Mid(SomeString, InStrRev(SomeString, "\") + 1)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now