In what I do, I have to handle pretty large files all the time. In my setup,
I have 3 hard disks:
C: which is meant to only run windows and barely has any space on it left
after XP was installed.
D: which is where I store all my files.
E: where I want my temporary files to be.
How would you go about changing the location of the temp folder to E:/ in
Aside from your small C: partition, you’re describing a reasonably good set
up. By moving your temporary files to E: you should not only get an improvement
in available space on C:, but things might also speed up just a tad.
Become a Patron of Ask Leo! and go ad-free!
First, I want to be clear to everyone that we’re not talking about Internet
Explorer’s temporary files. Those are controlled by settings in Internet
Explorer’s options. Similarly, many applications also allow you to specify
alternate locations for temporary files used by that application.
We’re talking about Windows itself.
Windows has a concept of a directory where it, and other applications if
they so choose, can place files that are for temporary use only.
Fire up a Windows Command Prompt, (typically in Start,
All Programs, Accessories), and in that
windows type SET followed by the Enter key.
Windows will list a number of what are called “environment variables” that make
various types of information available to running programs. Two of them will
look much like this:
TMP and TEMP both specify the directory to be used for temporary files. Both
TMP and TEMP are used for compatibility reasons. In this example they actually
specify “C:\Documents and Settings\LeoN\Local Settings\Temp”, but in 8.3 compatibility
Changing them is easy.
Right click on My Computer and click on
Properties. In the resulting dialog click on the
Advanced tab and you should see something like this:
Click on the button near the bottom labeled Environment
Variables, and you’ll see something like this:
You may see both TMP and TEMP listed in the section labeled User
variables for (account). That’s the common location; each different
login account is assigned its own temporary location.
Personally, I prefer to have a single location for the entire system. So if
TMP and TEMP are present in the top list, I click on each and then click on
Delete. However you can simply edit them, as we’re about to
edit the System copies, if you prefer.
directory is set to the root of a drive.”
If you scroll down in the bottom list labeled System
Variables you’ll find TMP and TEMP again. Click on one, and then press
the Edit button:
In the Variable value: edit box you can now specify a path
to a directory that Windows and many other programs should use for temporary
files. As you can see, I’ve specified a different directory entirely, but still
on the C: drive. You could specify “E:\” to use all of E: as your temporary
location, but I’d actually recommend creating a subdirectory on E:, such as
perhaps “E:\temp” and using that, as some programs can get confused if the temp
directory is set to the root of a drive.
Be sure and repeat that process for both TMP and TEMP.
You’ll need to restart any running programs for the new value to take
effect. In fact, you’ll need to restart Windows for it to begin using the new
value for its own temporary files.
33 comments on “How do I change the location of Windows temporary files?”
Apart from the temp files created, or used, by Internet Explorer, is it safe to delete any other temp files?
How do I know if I have more than one hard drive?
I know I have C:, however, when I had to reformat and install windows XP clean, it deleted and re-created a new C: drive…
I am not sure if I have a D: or E: drive….
If so, how do I find out if I have one or the other?
—–BEGIN PGP SIGNED MESSAGE—–
wlc network: Typically, yes. New article on that:
—–BEGIN PGP SIGNATURE—–
Version: GnuPG v1.4.6 (MingW32)
—–END PGP SIGNATURE—–
—–BEGIN PGP SIGNED MESSAGE—–
Apeke: drives should be listed in Windows Explorer.
You might also try disk manager: Right click on “My Computer”, click on
“Manage”, click on “Disk Management” and that should show you what you have.
—–BEGIN PGP SIGNATURE—–
Version: GnuPG v1.4.6 (MingW32)
—–END PGP SIGNATURE—–
Is there anyway I can change my default location of my music and my pictures folder?
At the plcae of C letter , I have %system%
How to make wih this expression ?
I have made the changes above because I had the same problem with a small partition as system disk which kept filling up. I’ve also moved the location of IE temp files. I now have programmes that won’t start – I use Adobe CS3 and non of the programmes will start. I tried uninstall to reinstall and the system said that critical files are missing. When inserting the disc to reinstall CS3, it gets as far as Adobe set up window, then it goes off the screen without continuing set up. Please help – what have I done????? FYI I have renamed temp files G:\Local Settings\Temp. Many thanks
Nice little guide! It might also be beneficial for this person to put their swap file on E: if that’s a fast drive.
One thing I can’t figure out though: How do you tell Windows XP where to put its Windows Update temporary files? It seems to just pick the drive with the most free space, which is not what I want it to do.
Thank you – you saved me! I have Windows XP on a partition, and I tried copying a batch of files from an external drive to another partition, next thing you know Windows has spat its dummy because the C: drive is full (to the brim!). I was dreading the prospect of having to reboot from scratch, but now I’ve changed the location of the Windows temp folder – so big thanks!
You may also consider deleting any *.TMP and TEMP folder files with professional software (something like History Killer Pro) on Windows start-up.
How can I install Adobe reader to my E drive?
Dear Leo,Thanks so much for the help. I have a new problem: according to your instruction, I changed TEMP and TMP to E:?TEMP,but the Adobe is a;ways installed to C drive not E drive, very anoying. Please help me to install all temperary file to E drive because my C drive only has less then 15% mem left. Thank you.
Now I can finally use 7-Zip as it uses a temp folder for file extraction, and I ran out of space on C.
I tried to do this in Windows 7 (change the variable value to D:\TEMP) but I don’t see TEMP folder in the D drive.
Thanks Leo. I have another question. What happen if I also edit the TMP and TEMP under User Variable for ?
In Windows 7, under User variable for the value for TEMP and TMP is %USERPROFILE%\AppData\Lacal\Temp, and under System variables the value for TEMP and TMP is %SystemRoot%\TEMP. How do I change it to another drive? Thanks.
Usually I have 2 accounts (admin and user) in my WinXP and I use this method to keep temp files in one location. I.e. both account’s temp folder and the system temp are same. Also this needs some security tip. Because all accounts (admin, user and any built-in ones ) and the system access same folder, I change the folder’s permission as “Everyone | Full access”. And my question: recently I moved to Win7 and found that I can use this method only for admin account. When I’m trying to access “Computer | Advanced system settings” (where Environment var-s located) from a standard user account, I have to switch to the admin acccount, so I get env var-s of the admin. In WinXP there was no problem. Any help?
User accounts | Change my environment variables
Thanks for the article. However, if I would like to have temp environment changed for all my users who logon to a Terminal Service, how do I do that. Is there a registry entry which I could change? I need to change it for all my users do to an application which does not like long paths for TEMP.
Does this move the files, or just change the pointer for any new entries? I want to actually MOVE the filter in my current TMP and TEMP folders. I have used the above operations, and it works for any new entries. But, I am afraid that, if I move the current info to the new locations, it will screw up any previous file installations and/or registry entries.
Instead of using the GUI is easier to just use the command prompt as:
SET TEMP=F:Temp (replace with desired location)
great post. Have been looking for how to do this forever as my main drive is a ssd to its not the biggest, now i can work with large files without getting errors.
I’ve been having this issue the past two days since I did the same thing! I only gave xp about 9 gigs of space and now it’s freaking out..can’t download anything..i moved my internet temp folders but couldn’t figure out how to move the windows temp files. Thanks so much!
Very useful, except I cannot find the command prompt command, it’s not where Windows says it should be (in the start/accessories section). Do you have an idea where it might be hiding pease ?
Dank u wel
Great post, I’m running out of space and now I can free some – THX !
And to give something back – Start, Run = WindowsKey+r
Using cmd/command prompt to change these variables is not effective. It will only change them for that cmd session.
You must use the GUI if you want the changes to stick.
I only have C and D partitions on my hard drive. Can I do the same to move the temp folder to D or do I need a third location?
It’s fine to have your Temp folder on the C or D or wherever space allows. The E drive was just a hypothetical example of where the Temp folder could be moved in case the C and D drives were too small to hold it.
Wielkie dzieki from Poland, Leo!
At last, I’ll be able to get the whole 9-hours-long parliament session downloaded :)
If only I could know why the IE chooses once “Temporary Internet Files”, once “Temp”…
Is it okay if I use an External Drive for the temporary files, instead of the Internal one?
My friend computer locked & all default users & admins are diabled how to hack the machine without formating xp Sp 3…?
How to crack xp Admin password ., while all default accounts are diabled …..
It is possible to reset the Windows passwords by downloading the Offline NT Password and Registry Editor, burning it to a CD.
I’ve lost the password to my Windows Administrator account, how do I get it back?
After changing the path for TEMP and TMP i rebooted the system, but no change in size filled of my SSD drive (Boot Drive), so i checked, they were not moved to the new location (obviously) and almost everything in the Temp folder (at the usual location) was gone.
After trying a few times more i found out (here) that i need to create the folder first at the new location, i did so, and tried again.
Again, no luck and i still can’t figure out where my Temp files went and my main drive (SSD) was still 49GB/58GB (filled).
Any had same situation and solved it? i can’t find a solution
I would like to thank you very much for the help that you done for me. I was in a bid trouble with that. So you solved that. Thank you very very much Leo.