Find the full path of a file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi folks,

I have two files (fileA.txt and fileB.txt) in the same folder. Could anyone
tell me the way to delete fileB.txt without knowing the path of fileB.txt?
In other words, I want to know the full path of fileA.txt.

Thanks in advance.

Tim
 
Just delete fielB.txt! :-)

Now if my answer seems a bit open and lacking in detail, you might
consider what information you've given us in hopes of receiving an
answer.

The long and the short of it is that the executing program must be
given the information by some means so that it can find and kill the
one and only correct file and intelligently communicate any exceptions
to the user. You have communicated one useful bit of information:
FileA.txt and FileB.txt exist in the same folder. Now step right up
and explain how you got to the correct folder and what you did there
before you want to kill FileB.txt.

Another issue: you haven't stated that MS Access is even a
consideration in your issue. This newsgroup is for Access, the
relational database application from Microsoft.

HTH
 
Hi Duane/Larry,

Sorry for the lacking information. I am using Access XP for this project.
So far, both of the files are located in c:\temp but the folder will be moved
when they move to production for different sites. Therefore, I need some
code to get the path of fileA.txt.

Thanks in advance.

Tim.
 
Are you thinking you need to search the entire hard drive and possibly other
local hard drives and network drives to find A.txt?
 
Will it always be in the users temp folder? If so, I believe there is code
to find the location of the users temp folder in the API section at
www.mvps.org/access

Alternatively, if the folder is relative to the folder where the Access app
is installed, you can get that folder with CurrentProject.Path. For example,
I have a Help folder which is a subfolder of the folder where one of my apps
is installed, I can refer to it in code as ...

CurrentProject.Path & "\Help"
 
Back
Top