Why does% TEMP% allow a non-deterministic path of the form% TEMP \ <digit>?
I have a 32-bit version of Windows Server 2008, and when I type% temp%, it takes me to .AppData \ Local \ Temp \ 1 \ or..AppData \ Local \ Temp \ 2 instead of..AppData \ Local \ Temp
I already checked the environment variables and they are fine.
I ask because I have an application that should copy files to% temp% \ my application and instead it copies files to% temp% \ 1 \ my application
Does anyone have a solution for this?
Explanation, discussion, workarounds, etc., all within the framework of the article Old New Thing Why the name of my TEMP directory continues to change - it provides several Terminal Services sessions for the same user do not have (by default) temp folder shared .
The problem is Group Policy Administrative Templates \ Windows Components \ Terminal Services \ Temporary folders . If you did not select Do not use temporary folders per session , then TEMP subdirectories are created. There is also a knowledge base article describing the registry keys behind these group policies .
Personally, I think the first comment in the answer will be most useful:
Why does it matter if a temporary location pops up anyway, it's temporary!