How to change TEMP environment for ALL users

I need a way to set my Windows 7 so that each time I add a new user to the PC it inherits the TEMP and TMP environment settings to C:\Temp instead of default windows 7 location (%USERPROFILE%\AppData|Local|Temp).

I have seen this cannot be done by changing the HKEY_CURRENT_USER in the Admin account, as it doesn't keep persistent thru all users.

I need this way works also for all existent users, modifying their TEMP environment centrally from Admin account.
LVL 14
Fabio MarzoccaFreelancerAsked:
Who is Participating?
jakethecatukConnect With a Mentor Commented:
Sorry about that...been a long time since I've done this.

This works as I've just done it: -
1) Modify Explorer settings to let you see hidden files
2) Go to Start-> Run -> type regedit
3) In the left pane of Registry Hightlight HKEY_USERS
4) Go to File -> Load Hive
5) Look in C:\Users\Default users and import ntuser.dat (name it Default user)
6) Look for key HKEY_USERS\Default user\Environment
7) modify TEMP and TMP to C:\TEMP
8) Unload Hive

You will have to do it this way for all users as well.
You need to change the registry value for HKEY_USERS\.Default\Environment\Temp to what you need.

Any new users that login will get the new value - this does not affect existing users thoug.
Fabio MarzoccaFreelancerAuthor Commented:
Thanks jake.. any way to change also on existing users?
Under HKEY_USERS will be all the users starting with S-1-5- etc.  Under each tree will be the Environment variables sub tree.  You can change it in there.
Fabio MarzoccaFreelancerAuthor Commented:
I have just tested as you said, modifying HKEY_USERS\Default\Environment  with the new directory. Created a new user, but the environment is still the default one: %USERPROFILE%\AppData|Local|Temp
All Courses

From novice to tech pro — start learning today.