All Delphi

Everything You Want To Know From VCL, Tips To Snippet All Everything About Delphi And CodeGear Related

How To Retrieve Temporary Folder

26th November 2009

AllDelphi.com Reader ,Have you ever got to the point where you need to know what is the full path for temporary folder on your system ?, or maybe need the temporary folder to put some scratch file or temporary file to be use on your system but don’t know for sure where is the temporary folder exact path ?
Well , dont worry bellow is the snippet that you can use,
enojy..

dont forget to put the uses clause ..


  Uses ShellAPI;

function GetTempDirectory: String;
var
  tmp: array[0..MAX_PATH] of Char;
begin
  GetTempPath(MAX_PATH, @tmp);
  result := StrPas(tmp);
end;
Bookmark and Share
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • StumbleUpon
  • Technorati

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>