Helping people with computers... one answer at a time.

Windows maintains a location where programs can put temporary files. Sometimes you might want to change that location, and it's fairly easy to do so.

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 Windows XP?

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.

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 representation.

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:

System Properties dialog, Advanced tab

Click on the button near the bottom labeled Environment Variables, and you'll see something like this:

System Properties, Environment Variables dialog

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.

"... some programs can get confused if the temp 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:

System Properties, Edit Environment Variable dialog

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.

Article C2986 - April 6, 2007 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

wlc network
April 7, 2007 12:19 AM

Apart from the temp files created, or used, by Internet Explorer, is it safe to delete any other temp files?

April 7, 2007 9:02 AM

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?

Leo A. Notenboom
April 8, 2007 11:38 AM

Hash: SHA1

wlc network: Typically, yes. New article on that:

Version: GnuPG v1.4.6 (MingW32)


Leo A. Notenboom
April 8, 2007 12:10 PM

Hash: SHA1

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.

Version: GnuPG v1.4.6 (MingW32)


April 8, 2007 7:25 PM

Is there anyway I can change my default location of my music and my pictures folder?

July 28, 2007 2:00 PM

Thanks for the info. Much appreciate it !!

April 6, 2008 5:54 PM

At the plcae of C letter , I have %system%
How to make wih this expression ?

December 19, 2008 4:00 AM

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

February 24, 2009 3:27 AM

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.

April 3, 2009 3:47 AM

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!

May 5, 2009 10:48 PM

You may also consider deleting any *.TMP and TEMP folder files with professional software (something like History Killer Pro) on Windows start-up.

September 3, 2009 1:17 PM

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.

Yonathan Zarkovian
September 4, 2009 7:51 AM

Now I can finally use 7-Zip as it uses a temp folder for file extraction, and I ran out of space on C.


November 29, 2009 12:37 AM

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.

You have to create the folder first before it can be used. Setting the TMP variable only tells Windows what folder to use, it will not create that folder.

November 29, 2009 11:20 PM

Thanks Leo. I have another question. What happen if I also edit the TMP and TEMP under User Variable for ?

Same thing. Those are user-specific settings, and apply to you when you're logged in. You can delete them and the system settings will take over, or you can set them to whatever you like.

November 30, 2009 2:07 AM

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.

Just set it to the explicit path, like "D:\MyTempFolder"

January 7, 2010 10:13 PM

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?

January 10, 2010 2:55 AM

User accounts | Change my environment variables

Mohammed Khawaja
January 26, 2010 8:22 AM

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.

March 9, 2010 1:31 PM

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.

Rolando Lopez
March 15, 2010 6:13 PM

Instead of using the GUI is easier to just use the command prompt as:
SET TEMP=F:\Temp (replace with desired location)

July 6, 2010 1:13 AM

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.

Thanks alot

July 16, 2010 9:35 AM

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!

July 21, 2010 11:37 PM

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


Just click on Start, Run and then type in "cmd" as the command to run. That's the Windows Command Prompt.

March 14, 2011 11:07 PM

Great post, I'm running out of space and now I can free some - THX !
And to give something back - Start, Run = WindowsKey+r

August 12, 2011 12:26 PM

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.

October 29, 2011 10:04 AM

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?

Mark J
October 29, 2011 4:56 PM

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.

November 20, 2011 6:55 PM

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"...

January 12, 2012 9:20 PM

Thanks, Leo!

Is it okay if I use an External Drive for the temporary files, instead of the Internal one?

You can, but it will likely slow down your system, potentially a lot, as external drives are often much slower than interal.
March 17, 2012 10:53 AM

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 .....

Mark J
March 17, 2012 3:25 PM

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?

May 5, 2012 1:21 AM

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

October 18, 2012 3:10 PM

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.

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to to ask your question.