Create the destination first
Both variables must point at an existing folder. A missing folder makes installers fail with a permission error that names the installer, not the path.
mkdir D:\emp
Temporary files fill the system drive and shorten the life of a small SSD. Moving them is one environment variable and one restart, with two caveats.
Create a **Temp** folder on the target drive, set **TEMP** and **TMP** for the user, then for the system, and reboot. Some installers still write to the system drive and a network path breaks them.
Both variables must point at an existing folder. A missing folder makes installers fail with a permission error that names the installer, not the path.
mkdir D:\emp
The user-level values cover most applications and need no elevation. Open the environment editor and change both TEMP and TMP, which Windows treats as separate names for the same idea.
SystemPropertiesAdvanced.exe > Environment Variables
The system-level values cover services and installers that run as another account. Change them too if the point is to keep the system drive small; leave them if a store app complains.
setx /M TEMP D:\emp
The old Temp folder still holds files in use by running processes. Clear what can be removed with the disk cleanup tool instead of deleting the folder itself.
cleanmgr
A network share or a removable drive makes temporary files slow and can break a program mid-install. The target must be an internal drive that is always present.
Open a fresh terminal and print both variables. An old window keeps the values it started with, which is why a change that appears not to work is often a stale process.
echo %TEMP%
The folder permissions or the path. Grant your account full control and check for a typo in the variable.
That app uses its own path or the machine variable. Check both.
Temporary files are latency-sensitive. A hard drive for Temp makes installs slower, not faster.
Set both variables back to the default paths and reboot. That restores the original behaviour.
Usually a few gigabytes, more after large installs and video exports.
Marginally. Modern drives tolerate the write volume of a temp folder easily.
Set **TEMP** and **TMP** back to **%USERPROFILE%\AppData\Local\Temp** (user and machine) and reboot. The folder on the second drive can then be deleted.
Free · no account needed · tracks your progress