views:

810

answers:

3

On my computer, both points to the same location.

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

+2  A: 

I think only for compatibility, as I could see in Windows starting from NT 4.0 both variables were targeted to the same location in %WinDir%\Temp\

Also I never saw using %TMP%, every time it was talking about %TEMP%.

abatishchev
+1 compatibility. Back to the days of MS-DOS when some apps used TMP and others used TEMP. (Could even be back from Unix vs. CPM style.)
Richard
+4  A: 

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.

TorgoGuy
+3  A: 
VonC
MS-DOS Shell screenshot--That brings back memories. Thanks!
TorgoGuy