%TEMP% Env Variable

Is there a need for having multiple values for the System's %TEMP% variable From a design point of view, is it safe to assume it as a single valued variable

Incase it is a multi-entry variable is there a registry entry or some reference that separates the %TEMP% value created by Windows and %TEMP% value created by a 3rd party program How can I make sure that I use the one that is defaulted/created by Windows

Thanks in advance!




Answer this question

%TEMP% Env Variable

  • Simon Honeybone

    In .NET it's safer to use Path.GetTempPath(), it will deal with retrieving values from the TEMP env. variable if needed.

  • T.C.

    when I access the environmental variables through .NET, it gets the User related %TEMP%. No problem there.,

    My main concern is if the variable is designed for supporting multiple values for example:

    "C:\DOCUME~1\yourprofile\LOCALS~1\Temp;C:\Program Files\Microsoft SQL Server\80;C:\TEMP"

    or is it just always expected to have a single value, example:

    "C:\DOCUME~1\yourprofile\LOCALS~1\Temp"

    Should I ever expect multiple values for %TEMP% variable in my program logic



  • Loup

    I think this would have usability implications… and most certainly privacy implications as well; both are better addressed with a unique %TEMP% value for each user context.

    Dan


  • %TEMP% Env Variable