Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between %TMP% and %TEMP% in Vista environment variables?

Tags:

On my computer, the environment variables %TMP% and %TEMP% both point to the same location.

Are those for backward compatibility issues only, or is there a real difference?

like image 911
Brann Avatar asked Feb 24 '09 14:02

Brann


People also ask

What are TEMP and TMP environment variables?

The TEMP/TMP environment variables specify the location in which most programs place temporary files. By default, TEMP/TMP location is in the Windows partition. To speed up the access, you may set the TEMP/TMP variables to a ram disk.

How do I change TEMP and TMP variables?

Select the Advanced tab and click the [Environment Variables] button. The Environment Variables dialog box will be displayed. The paths for TMP and TEMP variables are listed in the User variables for (account) section. This is the default location assigned by the system to store temporary files.

What are environment variables in Windows?

Environment variables store data that is used by the operating system and other programs. For example, the WINDIR environment variable contains the location of the Windows installation directory. Programs can query the value of this variable to determine where Windows operating system files are located.

What is $Tmpdir?

TMPDIR is the canonical environment variable in Unix and POSIX that should be used to specify a temporary directory for scratch space. Most Unix programs will honor this setting and use its value to denote the scratch area for temporary files instead of the common default of /tmp or /var/tmp.


1 Answers

It is for compatibility. It goes all the way back to DOS. Since there were no standards, some DOS (and Win 3.x) applications would look for the %TMP% environment variable and others would look for %TEMP%. You were best off if you set both of them in the AUTOEXEC.BAT file.

Windows NT set both of them automatically just to make sure all of the apps continued to work OK. %TEMP% is the standard now, but %TMP% lives on.

EDIT: Looks like Richard already mentioned the DOS aspect in a comment.

like image 92
TorgoGuy Avatar answered Oct 19 '22 12:10

TorgoGuy