Mega Code Archive

 
Categories / Delphi / System
 

Finding the windows TEMP dir

Title: Finding the windows TEMP dir Question: How do I get the windows TEMP dir, so I can dump some temporary data? Answer: very easy to do, here's how: function GetTempPath: String; var Buffer: array[0..1023] of Char; begin SetString(Result, Buffer, GetTempPath(Sizeof(Buffer)-1,Buffer)); end; this code can also be used for: GetCurrentDirectory GetSystemDirectory GetWindowsDirectory Hope this helps someone.