Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
Noise

Temp Environmental Variables In Server 2008/2008R2

Recommended Posts

Does anyone know what's going on here:

In Windows Server 2008 and 2008R2 The TEMP and TMP directory settings are set in the System Properties (like previous versions). However, when I open a command prompt or open explorer in the %TEMP% directory the setting is appended with a subdirectory. The subdirectory is a number and seems to correlate to the session you are currently working under. For example, if I have the user TEMP variable set to C:\TEMP in system properties and I open a command prompt window and type, "ECHO %TEMP%" the result will be C:\TEMP\1\ (see screenshot).

tempdirchange.png

Why is Windows doing this, and how do I turn it off?

Share this post


Link to post
Share on other sites

When you do an Echo from the command line, it is returning to you the User Temp Variable (see top of your screen shot) while the system temp variable it C:\Windows\temp, the User Temp is %USERPROFILE%\appdata\local\temp.

Share this post


Link to post
Share on other sites

This concept was originally was created by Citrix when they produced WinFrame as a way of handling multiple user sessions on the same machine as a way to handle keeping each user's temp location unique to each user. Microsoft added it to their OS subsequently as they added Windows Terminal Services to the OS, and this only happened when logging into a terminal services session.

With the evolution of the OS in the Vista timeframe, Micrsooft added the ability for you to have multiple users logged into the OS console at the same time and switch between user sessions, to do that they used the same concept borrowed from the Windows Terminal Services side of the OS.

It is just a mechanism to keep the temp variable locations unique and separate between users. The number used for the directory is actually the session ID number for the user session.

Share this post


Link to post
Share on other sites

It doesn't make sense though. In Windows (with the exception of terminal server) you can't have multiple sessions of the same user account active at the same time. And separate accounts all have separate temp directory locations. Am I wrong here?

I'm only asking this because I was running in to a huge problem installing ESET Remote Administrator on a newly installed pristine Windows Server 2008 box. The installation program was using the user settings from the registry and the modified one with the appended directory. This caused it to bomb out big time. I finally fixed the problem by setting the user tmp/temp variables to point to the appended temp directory.

Share this post


Link to post
Share on other sites
It doesn't make sense though. In Windows (with the exception of terminal server) you can't have multiple sessions of the same user account active at the same time. And separate accounts all have separate temp directory locations. Am I wrong here?

I'm only asking this because I was running in to a huge problem installing ESET Remote Administrator on a newly installed pristine Windows Server 2008 box. The installation program was using the user settings from the registry and the modified one with the appended directory. This caused it to bomb out big time. I finally fixed the problem by setting the user tmp/temp variables to point to the appended temp directory.

Hmm, don't server products allow 3 administrative logins even with Terminal Server disabled. One to the console (the zero session), and two additional sessions. That used to be my favorite feature of W2K3, even had termsrv.dll hack to make Vista act the same way.

I think if you use the Remote Desktops.msc (not the normal Remote Desktop - big difference) it can specify which session you want to connect with. For W7/2008/R2 I think the new version is in the RSAT

It's worth a shot, try logging into the zero session and report back if that resolves the issue.

Share this post


Link to post
Share on other sites

Yes, 2 sessions - however, there's no logging into session 0 on 2008 or 2008 R2 anymore, so you only get two. Even local logins aren't session 0 anymore, for what it's worth, that usually catches admins by surprise when they move from 2003 to 2008 / R2.

Share this post


Link to post
Share on other sites

I had a suspicion they might have changed that.

More details.

@MrJinje - You know what they say about thinking. STOP IT!

Edited by MrJinje

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...