That is an Environment setting. http://msdn.microsoft.com/en-us/library/77zkk0b6.aspx
var tmp = Environment.GetEnvironmentVariable("tmp");
UPDATE: I went to a command prompt and did
SET TMP=C:\Temp
Then I launched visual studio from my command prompt. Now my environment is updated and visual studio sees it. The code above (as well as yours) worked for me. It displayed the updated environment settings.
So I believe you would have to kill explorer or logoff in order to get the new environment to be seen permenantly.