We help IT Professionals succeed at work.

Temp directory in WIN2000

ZafodBiblbrox
on
Medium Priority
212 Views
Last Modified: 2010-08-05
How can i find temp directory in Win2000 (from registry)?


Zafod
Comment
Watch Question

Commented:
Look under these keys

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session Manager\Environment


THe Crazy One
Commented:
Zafod,

Is there any reason why you want to use the registry rather than the Win32 API call GetTempPath?

The following code will do the trick for you:

var
  lBuff: array[0..MAX_PATH] of char;
begin
  FillChar(lBuff, Succ(MAX_PATH), 0);
  if (GetTempPath(MAX_PATH, lBuff) <> 0) then begin
//  do what you want with lBuff as it contains the path to the TEMP directory
    end;
end;

Author

Commented:
Thanx
Zafod

Explore More ContentExplore courses, solutions, and other research materials related to this topic.