2

A windows 2000 computer running Terminal Service creates a temporary folder for each terminal session, and it appends the hexadecimal value to the temporary folder name depicted by the environment variable %TEMP%.

Reference

Terminal Services Temporary Folder Configuration Is Stored in Multiple Registry Locations

Temporary Folders

Use separate temporary folders for each session

My Question is does %TMP% also behaves in the similar manner as %TEMP% or it refers to a different location (the parent directory of %TEMP%).

Note I know people would tend to say that this question is related to SU but I am trying to use the Environment Variables in my program as a temporary store. So that makes it a programming question. Problem is that as TEMP folder is deleted once the user logs of this creates issues causes services to crash. Ok I understand this is not a good solution to use temporary store but we just looking for a short term solution until we come up with something better.

Abhijit
  • 62,056
  • 18
  • 131
  • 204

1 Answers1

0

TorgoGUy Have answered a question similar to this:

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

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.

And Yes both variables %TMP% & %TEMP% point to the same location %WinDir%\Temp\

Hope this helps.

Community
  • 1
  • 1
talha2k
  • 24,937
  • 4
  • 62
  • 81
  • Actually I did see the link but the scenario is different here. If you see the links included, you will see that on a Windows Server, using Terminal Service, the TEMP location is appended with a session value something like c:\Users\\AppData\Local\Temp\, which is something not desirable. I have checked that this only affects %TEMP% and not %TMP%. Also all the msdn links mentions about %TEMP%. I would like to know, if it is well documented that session value is not suffixed with %TMP%. – Abhijit May 24 '12 at 07:04