How to Change Default Location of Temporary Files Folder in Vista, Windows 7, and Windows 8

information   Information
Temporary files are files that are stored and used in the system and/or user TEMP and TMP folders temporarily while a task is being performed.

Temporary files can be created while, for example:

  • Installing programs, drivers, etc....
  • Created by Windows during normal usage when there may not be enough memory allocated for the task.

Once the task has finished, the temporary files are no longer needed. Usually the temporary files will be automatically deleted afterwards, but this is not always the case, and can lead to wasted disk space. If you have a small Windows drive, then space is most likely already tight.

This tutorial will show you how to change the default location of the TEMP files folder to any local drive location you like in Vista, Windows 7, and Windows 8.

Note   Note
System temporary files used by Windows are stored in the single hidden folder below by default.

  • %systemdrive%\Windows\Temp

User temporary files are stored in the hidden folder below by default. Each user account, has their own separate TEMP folder.

  • %userprofile%\AppData\Local\Temp

warning   Warning
You do not want to have all users share the same TEMP folder for security reasons.

You also do not want the system and users to share the same TEMP folder.




OPTION ONE
To Change Windows TEMP Folder Location in Environment Variables

1. If you have not already, create new separate Temp folders at the location you like to be used as the new user (ex: F:\Temp) and system (ex: F:\System\Temp) TEMP folders.
NOTE: You will need these folders in steps 7 and 8 below.

2. If you are signed in as a standard user, then press the Windows + R keys to open the Run dialog, copy and paste the command below, press Enter, and go to step 7 below.

rundll32 sysdm.cpl,EditEnvironmentVariables

3. If you are signed in as an administrator, then open the Control Panel (icons view), click/tap on the System icon, close the Control Panel, and go to step 4 below.

4. Click/tap on the Advanced system settings link on the left side. (see screenshot below)

Click image for larger version

5. If prompted by UAC, then click/tap on Yes (Windows 7/8) or Continue (Vista).

6. In the Advanced tab, click/tap on the Environmental Variables button, and do either or both steps 6 and 7 below for what you would like to do. (see screenshot below)

Name:  Change_Temp_Folder_Location-2.jpg
Views: 48889
Size:  59.1 KB

7. To Change "User" TEMP Folder Location
NOTE: This will only change the user TEMP folder location for your user account.

A) At the top under "User variables for (user-name)", select the TEMP variable, and click/tap on Edit. (see screenshot below)

Name:  Change_Temp_Folder_Location-3.jpg
Views: 48899
Size:  55.2 KB

B) In only the Variable value field, type in the full path (ex: F:\Temp) of the user temp folder you created in step 1 above, and click/tap on OK. (see screenshot below)

Name:  Change_Temp_Folder_Location-4.jpg
Views: 48769
Size:  16.1 KB

C) Repeat steps 7A and 7B above for the TMP variable.


8. To Change "System" TEMP Folder Location
NOTE: You must be signed in as an administrator to be able to do this step. This will change the system TEMP folder location for the Windows operating system.

A) Under "System variables", scroll down a bit, select the TEMP variable, and click/tap on Edit. (see screenshot below)

Name:  Change_Temp_Folder_Location-5.jpg
Views: 48773
Size:  50.0 KB

B) In only the Variable value field, type in the full path (ex: F:\System\Temp) of the system temp folder you created in step 1 above, and click/tap on OK. (see screenshot below)

Name:  Change_Temp_Folder_Location-6.jpg
Views: 48630
Size:  15.4 KB

C) Repeat steps 8A and 8B above for the TMP variable.


9.
Click/tap on OK. (see screenshot below step 7A or 8A)

10. If administrator, click/tap on OK. (see screenshot below step 6)

11. Restart the PC to apply.






OPTION TWO
To Change Windows TEMP Folder Location in Registry Editor

NOTE: Standard users will only be able to change their user TEMP folder location using this option. Administrators will be able to change both their user TEMP folder location and the Windows system TEMP folder location using this option.

1. If you have not already, create new separate Temp folders at the location you like to be used as the new user (ex: F:\Temp) and system (ex: F:\System\Temp) TEMP folders.
NOTE: You will need these folders in steps 5 and 6 below.

2. Press the Windows + R keys to open the Run dialog, type regedit, and press Enter.

3. If prompted by UAC, then click/tap on Yes (Windows 7/8) or Continue (Vista).

4. Do either or both steps 5 and 6 below for what you would like or able to do.

5. To Change "User" TEMP Folder Location
NOTE:
This will only change the user TEMP folder location for your user account.

A) In regedit, navigate to the location below. (see screenshot below)

HKEY_CURRENT_USER\Environment

Click image for larger version

B) In the right pane of Environment, double click/tap on TEMP to modify it. (see screenshot above)

C) Type in the full path (ex: F:\Temp) of the user temp folder you created in step 1 above, and click/tap on OK. (see screenshot below)

Name:  User_Temp_Folders_Registry-2.jpg
Views: 48640
Size:  19.0 KB

D) Repeat steps 5B and 5C above for the TMP expandable string value.


6. To Change "System" TEMP Folder Location
NOTE:
You must be signed in as an administrator to be able to do this step. This will change the system TEMP folder location for the Windows operating system.

A) In regedit, navigate to the location below. (see screenshot below)

Code:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

Click image for larger version

B) In the right pane of Environment, double click/tap on TEMP to modify it. (see screenshot above)

C) Type in the full path (ex: F:\System\Temp) of the system temp folder you created in step 1 above, and click/tap on OK. (see screenshot below)

Name:  User_Temp_Folders_Registry-2.jpg
Views: 48640
Size:  19.0 KB

D) Repeat steps 6B and 6C above for the TMP expandable string value.

7. When finished, close Registry Editor.

8. Restart the PC to apply.




That's it,
Shawn