How to change the default location for the temporary file folder to a
different hard disk?
In most cases there’s no reason or need to fiddle with this setting; it’s
default setting is quite appropriate for most common usage.
That “different hard disk” you mention in your question actually opens the
door to some scenarios where it actually is a useful setting to change.
I’ll show you how and then discuss some of the scenarios where it might make
sense to change.
Become a Patron of Ask Leo! and go ad-free!
TMP versus TEMP
First, let’s clear up one point of confusion.
For historical reasons, settings called both TMP and TEMP are used to
indicate the temporary folder that Windows will use. “Historical Reasons” means
that the setting is called “TMP” on the Unix operating system from which much
of this geekery was modeled, but someone along the way said “it should be more
readable” and added the “E” to turn it into something more like a word. The
problem of course is that not all programs changed, and thus both had to be
the temporary folder make some amount of sense, and both involve using a
It’s not uncommon for things that seem odd to be there because of “backwards
compatibility”, and this is one.
Unless I say otherwise, I’ll use TMP to refer to both TMP and TEMP.
My TMP Versus Your TMP Versus Windows TMP
Windows is a multi user operating system, even though we typically run it
one user at a time and even then Windows itself is kind of its own user.
The upshot is that each user login gets its own TMP setting, and the
operating system gets its own as well.
Thus, there can be many TMPs.
Show Me Your TMP
Let’s look at where to change ’em.
Right click on “My Computer”, or “Computer” – either in the start menu or
desktop – and click on Properties.
Click on Advanced, or Advanced System
Settings and you should get a dialog much like this one:
Click on the Environment Variables button to get this:
Right away you can see that the TMP settings for the currently logged-in
user – me in this case – are displayed right at the top. %USERPROFILE% is
replaced with “C:\Users\LeoN” in my case, so the temporary files are actually
If you click in the lower box and scroll down, you’ll see that there’s
another pair of settings:
As you can see, both TMP and TEMP are here as well, and are set to
The operating system will use “C:\Windows\Temp” as its temporary files
folder, and programs that you run will use
One Simple Change
To the best of my knowledge you don’t need both. By that I mean you don’t
really need separate settings for your login accounts and for the system. (If
you’re at all hesitant, you don’t need to make this change.)
So one approach that I frequently use is to simply delete the TMP and TEMP
settings from the “User variables” portion. Click on each, click on Delete and
If you have no user-specific TMP setting, the system setting will be used
instead. In other words, all the temporary files will end up in the same
Changing the Location
To change the value of the TMP and TEMP variables, double click on one to
get this edit box, and type in the new value:
Here you can see I’ve replaced the value with “d:\tmp”, a folder I’ve
created on one of my hard drives.
Press OK, repeat for TMP, and you’re done.
Well, you may have to reboot for the changes to take effect.
A couple of notes about making the change:
- The folder must exist – Windows will not create it for you.
If it doesn’t exist, it’s unclear what will happen, but most likely Windows
will put the temporary files is a random location, or some programs may not
work at all.
- As I said, you may need to reboot for the changes to take effect
- Only after you reboot should you clean up the “old” temporary folders. I
recommend removing their contents but leaving the empty folders around.
- Resist the urge to get tricky with the folder names or paths. The TMP
setting is used by many, many programs some of which may not behave properly
with spaces in file names, lengthy paths, or settings that are anything other
than simple. Yes, even after all this time.
There are two scenarios where changing the location of the temporary folder
makes some amount of sense, and both involve using a different
drive. If you’re moving it from one location on C: to another location on C:,
you’re not really improving anything.
Speed: If you have a separate physical drive, it
can sometimes be a small speed improvement to place your temporary files on
that drive. Exactly how much, or even if this will benefit you is extremely
dependent on your system configuration and how you use your computer. It’s even
possible that it could slow you down. But since it’s a relatively simple
change, it’s one of those changes that you can experiment with to see if the
results are beneficial.
Space: If your C: drive is filling up, but you have lots of
space on, say D: – then moving the temporary files folder can allow you to free
up that space on C:. In this case C: and D: could be two partitions on the same
drive, or different drives, it doesn’t matter. My only suggestion is that you
first empty your TMP folder before you go through the effort of moving it –
things frequently accumulate there and a simple cleaning may well resolve your
Finally, be aware that this is not related to your internet
browser in any way. Your “Temporary Internet Files” is a different animal
completely, and is controlled by the web browser or other internet program you
happen to use.