Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What the title says.

On windows, how do I set an environment variable for a user other than the currently logged in one. I need to set the TMP variable to change the temporary directory used by a asp.net app.

share|improve this question
    
As an unrelated comment: Why in the world would an ASP.NET application look to the computers Env. variables for a file path setting? AppSettings are built-in for that reason alone. –  Brent Pabst Jun 12 '12 at 16:48
    
Also, this question is off topic for ServerFault, it should be posted on SuperUser –  Brent Pabst Jun 12 '12 at 16:51
    
@BrentPabst - The standard temp directory api in .Net reads from it - msdn.microsoft.com/en-us/library/… –  George Mauer Jun 12 '12 at 18:26
    
Right, so what user is your application running under? Does it change that context each time a user logs in? Typically in IIS this is not the logged in user. –  Brent Pabst Jun 12 '12 at 22:10
    
@BrentPabst - I don't get what you're getting at. It runs under the same context every time (Network Service). But rather than setting the TMP variable for the entire server, I want to set it just for that user. I think what uSlackr recommends is going to work. Are you proposing another approach? –  George Mauer Jun 13 '12 at 12:46
add comment

1 Answer 1

up vote 3 down vote accepted

You can access through the registry. Modify the \Environment\Tmp key in HKEY_Users\<their SID>

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.