Accessing a Users Temporary Directory

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

Guest

From within a MS Access 2000 or later application I need to find the Temporary Directory (something like C:\Documents & Settings\User\Local Settings\Temp) of the user who is logged in. I think I may have to do something with WINAPI but I am not sure. Is this possible? Any help will be greatly appreciated.
 
For API solutions, check out http://vbnet.mvps.org/code/browse/csidl.htm
and/or http://vbnet.mvps.org/code/browse/shpathidlist.htm at Randy Birch's
VBNet site. (Warning: The site's aimed at VB programmers, so the form
instructions won't work in Access) There's also
http://www.mvps.org/access/api/api0010.htm at "The Access Web", but I'm not
sure what Temp folder that finds.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Joey07 said:
From within a MS Access 2000 or later application I need to find the
Temporary Directory (something like C:\Documents & Settings\User\Local
Settings\Temp) of the user who is logged in. I think I may have to do
something with WINAPI but I am not sure. Is this possible? Any help will be
greatly appreciated.
 
For a less high-tech approach, you can also just use
ENVIRON("TEMP")

That works for english versions of windows, unless someone is being
deliberately obscurant.

(david)

Joey07 said:
From within a MS Access 2000 or later application I need to find the
Temporary Directory (something like C:\Documents & Settings\User\Local
Settings\Temp) of the user who is logged in. I think I may have to do
something with WINAPI but I am not sure. Is this possible? Any help will be
greatly appreciated.
 
The solution to this problem was;


Dim tmpDir As String, fs As Object

Set fs = CreateObject("Scripting.FileSystemObject")
tmpDir = fs.GetSpecialFolder(2) & "\ExtCtrl.ini"
 
Back
Top