Where Does Windows Store Temporary Files and How to Change TEMP Folder Location?

Whenever we talk about free-up disk space on Windows PC, we always suggest to clear "TEMP" folder. Deleting all files and folders present in "TEMP" folder might provide you a decent amount of free space.

You might be wondering what is this "TEMP" folder and why is it created by Windows? "TEMP" folder, as the name suggests, is used to store temporary files and folders which are created by Windows services and many 3rd party software programs. Since the files and folders stored in Temp folder are temporary, its absolutely safe to remove them.

Now the question comes how to access this Temp folder to clear its content. There are 2 Temp folders present in Windows OS:

  • Temp folder present in C:\Windows folder
  • Temp folder present in Local Settings folder for each logged-in user

First "Temp" folder which is found in "C:\Windows\" directory is a system folder and is used by Windows to store temporary files.

Second "Temp" folder is stored in "%USERPROFILE%\AppData\Local\" directory in Windows Vista, 7 and 8 and in "%USERPROFILE%\Local Settings\" directory in Windows XP and previous versions. This folder is different for each Windows user i.e., each logged-in user gets a separate "Temp" folder. This "Temp" folder is used by 3rd party programs to store their temporary files for example, temporary downloaded parts of files by your download manager software, etc.

To access these 2 "Temp" folders, you need to use following commands:

  • TEMP
  • %TEMP%

You can run these commands in RUN dialog box or start menu search box. When you run TEMP command, it opens system "Temp" folder stored in C:\Windows directory and when you run %TEMP% command, it opens the user temp folder stored in "%USERPROFILE%" directory. You can learn more about these kind of environment variables using following tutorial:

List of Environment Variables in Windows XP, Vista and 7

Today in this tutorial, we'll show you how to tell Windows to use a single "Temp" folder for both system and user temporary files so that we don't need to open 2 different folders to free-up disk space.

We'll also learn changing location of "Temp" folder from C:\ drive to some other partition. The reason behind changing the location is very simple! First, it'll not eat valuable disk space of our system drive. Second, we'll not need to worry about clearing content of Temp folder regularly to free-up disk space on C: drive. It might also speed up your system a little bit.

So without wasting time, lets start the tutorial:

1. Right-click on Computer icon on Desktop and select Properties (or press WIN + Pause/Break keys). Now click on Advanced system settings link in left side pane. (You can open it directly by giving sysdm.cpl command in RUN or start menu search box)

2. Now click on Environment Variables button. It'll open a new window which will show a list of all environment variables defined in your Windows.

There would be 2 different sections:

  • User variables
  • System variables

You'll see TEMP and TMP variables listed in User variables section. The System variables section will contain a long list of various environment variables along with TEMP and TMP variables as shown in following screenshot:


3. Now to change location of TEMP folder from C:\Windows\Temp to other partition, first we'll need to create a new TEMP folder in the desired partition.

In this example, we are going to move TEMP folder location to D:\ drive, so we'll create a new folder "TEMP" in D:\ drive. Please note that you can use any name for the new folder, its not necessary to have TEMP as its name.

Now you can double-click on the TEMP variable present in System variables section or select it and click on Edit button. Now type location of new TEMP folder (which is D:\Temp in our case) and click on OK button.

Repeat same step for TMP variable as well.

That's it. It'll change the location of TEMP folder in Windows.

4. Now we'll ask Windows to use a single TEMP folder for both system and user temporary files. We can do this by either deleting both TEMP and TMP variables listed in User variables section or edit the variables and set their values to the same folder which we used for system variables in step 3 i.e., D:\Temp folder.

Once you delete both variables in User variables section or set their values to new TEMP folder path, it'll tell Windows to use a single TEMP folder to store all temporary files and folders created by Windows as well as 3rd party software programs.


5. You'll need to restart your system to take effect.

Believe me guys, setting user TEMP folder to same as system TEMP folder is one of the first few tasks which I always do after doing a fresh installation of Windows. Having separate TEMP folders is quite annoying to me. What about you?

Share this article: Facebook | Twitter | Google+ | Reddit | Tell a friend

Posted in: Windows 7, Windows Vista, Windows XP

Other similar articles that may interest you


  • can i change temporary folder for just 3rd software?
    i have no problem with temporary files created by windows, actualy i dont care about temporary files, but one of my 3rd software always make my temp folder full of crap, and my (:c) dont have much space left..
    what is the different of TEMP and TMP variable?

  • VG

    ^^ Of course. Follow Step 3 and set the values of both TEMP and TMP variables to your desired folder path.

  • Will the Windows cleanup app and third party cleaners like CCleaner beable to find the newly located Temp folder VG?

  • I think it would be better to make two separate folders like the default, but both in the same parent folder. That way things are still organized, and if you want to delete all TEMP files, you can still do it just as easily.

    Of course, this assumes that Windows automatically re-creates the TEMP folder if it's deleted and doesn't simply give you weird errors, which may or may not be true. (I honestly have no idea)

  • this is why I read askvg.com!
    can this be done with an bat/reg file, just interrested.

  • interesting thnx

  • @sasja I really don't think it can be done with a reg file, as it's probably not changing the registry. I'm not sure of the bat thing.

  • VG

    You can use SET command in command prompt to view, edit or delete environment variables. You can also create a BAT file to do it automatically.

    To learn more about SET command, type SET /? in Command Prompt.

  • Well you can do pretty much anything through a command line, and a bat file is basically just a 'robot' that types the commands for you :P

  • Well, this is the first and only tip found here that did not work out well for me...One third party program I use a lot is "Family Tree Maker 2012". I'm retired on disability, so I have *way* too much time on my hands, and family history helps me keep occupied. But it wouldn't even open when it couldn't find the Temp folder it was looking for at %USERPROFILE%\AppData\Local\Temp. I searched for a way to change the Temp location it needed to operate, but no luck. So I'm back to the way it was before, and Family Tree Maker is working fine again.

  • VG

    ^^ Did you change the user variable? It might also be possible that the TEMP folder path is hardcoded into the program and its not using what we have set in Windows.

  • I'm pretty sure you are correct about it being hard-coded into Family Tree Maker. I've looked through every possible place for options or settings within that program, and there is no way to change the location where it stores temp files. Ah, well, they've made a lot of improvements to the program since I first started using it back in about 1995...maybe they will eventually realize that it's not just little old ladies who are afraid of their computers who do family history, and let the end user have a little more control...

    Thanks for your response. Yours is still the best web site for Windows users!

  • In Vista-32bit if you're using old programs made for Win3 or Win9x they might flood temporary junk files to a third temp folder at:
    "%USERPROFILE%\AppData\Local\VirtualStore\Windows\Temp" or just

    But be aware, there can be .ini or other config files used by those old progs YOU SHOULD *NOT* DELETE. (But still if you nuke them all the old programs just get back their default set-ups.)

  • VG

    ^^ Thanks for your inputs. :)

  • HI All,

    Could you please help on this,

    How to Protect in temp folder files, user (including system administrator account) cannot do even copy & cut also from temp folder which is available with .tmp extension.
    Also could you please choose any third party tools also.

    Thanks ,

    Ramu Y.

  • VG

    ^^ You can change permissions on Temp folder using its Properties so that its not accessible to other users. But it might cause problems as this folder is used for many purposes and many software use it to store temporary files.

  • hi VG! Do u have any registry setting,i mean like making this with registqy eg temp.reg file for changing its defult dic?

  • VG

    ^^ Here you go:


  • no not that bro,, i need .reg file that makes or assains my own location as default,,

  • VG

    ^^ Just export that key and it'll create a .REG file. You can edit the file in Notepad and change the path to your desired folder.

  • Thanks... it's very useful

  • i am working online and would like to know if its possible to transfer/save my worksheet on a local drive and not be reflected in the main drive or server.

  • I followed the steps given above and changed location of TEMP and TMP to another drive under new folder "TEMP".
    problem 1. now my microsoft word keeps crashing with error message "work file could not be created, check the temp environment".
    problem 2. my c drive is still very close to full, though i have checked and all new temp and tmp files have been created in my new combined TEMP folder.

    what to do with the 2 problems that i have?

  • VG

    ^^ Regarding first problem make sure the new TEMP and TMP folders have full permissions and control. Also check Word settings and if you find any reference to old TEMP or TMP folders, change the path to new one.

    Regarding second problem, check out following tutorial:


  • How do I switch back to the original default folders on windows 8?

  • Would those be?:
    TEMP %USERPROFILE%\AppData\Local\Temp
    TMP %USERPROFILE%\AppData\Local\Temp

    TEMP C:\Windows\Temp
    TMP C:\Windows\Temp

    Silly me forgot to write them down before changing the path
    ( which is making some applications not respond )

  • VG

    ^^ Yes.

  • One more quick question, just to satisfy my scared mind, when I went to change it back, it no longer said Administrator Variables, it had my User Name at the top where Administrator used to be.

    I changed it back anyway thinking that after the reboot it would go back to Administrator Variables, it did not. Is that ok? Donald is the Administrator BTW.

    SEE PIC :


  • VG

    ^^ Dont worry about it. Its default behavior. In my system, its showing my username.

  • Oh thanks so much, good to know, kind of thought so but just wanted to be certain.
    Very kind of you to take the time to answer.

  • about the temp.. i always clean or deelete my temp using %temp% in run, then when i donwloading some files (mp3 or videos) it stored in temp not on my donwloading section. how i can returned on my suggested folder? thanks

  • VG

    ^^ Please provide more details.

  • The tutorial for moving TEMP folder was so easy to follow I could hardly believe it actually worked. Thank you so much. This page is bookmarked for sure.

  • Hello. I have problem, Wien I run an exe-file the system denie because of....
    "unable to make the map "C:/users/sture/AppData/Temp/is-Q361R.tmp". And... Cod 5:Access denied"
    I have done the check about path for Temp and Tmp, and its OK
    Any idea?

  • VG

    ^^ First of all please post your HijackThis log file in following topic:


  • Question/ What happens if I set the system to not accept Temp files? Does that cause any problems while using web sites? And could anyone recommend weather or not to sed mediun sized files vs. Low size , etc? I truly do not know what any of it means or how vulnerable it could make my computer to allow temp settings?

  • VG

    ^^ You can allow Windows to store temp files without any worries. Its absolutely safe.

  • I have over 3000 files named in this format: oct2EF2.tmp.png on my C: drive. When I delete them they come back. HELPPP!!!!!!!!!

  • VG

    ^^ Please post your HijackThis log file in following topic:


  • Thank you..
    Your article helped me to solve the 1622 error in Silverlight installation..

  • It's a great site.
    I'm newbie to win8.1 so maybe the question is trivial.
    I have a standard user (with local account) in my pc.
    I login in to her account. When I click on Advanced system settings a window pop-ups and asks
    administrator password. After typing it and clicking on Yes button
    an Environment Variables window pop-ups and shows the
    User variables for Administrator, not the user's ones.
    How is it possible to modify the user variables for standard user?

  • niCe

  • don't know if anyone will answer this but i don't want to relocate my temp folder i want to give it more space/ram/whatever it keeps running out of.

    im the kinda person that has a need for 20 note pad docs to be open with Skype ftp chrome and other various programs just to get what i need done so im always getting errors saying not enough space or memory to complete this action i have over 500 gigs left on hdd and 20 gigs of ddr3 Kingston hyper fury ram so idk what else i need but i would like to increase the space/memory to temp folder if there's a way thanks for reading.

  • VG

    ^^ Your issue is not related to TEMP folder. Its size is not restricted. You can try to increase the size of virtual memory/pagefile using System Properties.

  • Is it possible to keep the default location of the TEMP folder in tact and still remove unwanted temporary files, so as to free up disk space? I don't know much about computers (though exploring such issues is extremely enjoyable) so I don't want to tamper with anything technical with my computer. Any suggestions?

  • VG

    ^^ You can empty TEMP folder anytime you want. It contains only temporary files which are safe to delete.

  • This I'm sure is going to sound as if I'm completely ignorant, but I'd rather ask a dumb question than pay for a dumber result from doing something I shouldn't have!
    To be clear, when I get to my temp folder ( Computer - Local Disc (C:) - Windows - Temp ) the first 3/4 of what appears after 5 folders are all .log files... At this point, do I simply highlight everything I see and hit delete?? I'm using Windows 7 Home Premium.
    Thanks in advance for the assist!

  • VG

    ^^ Yes. Everything present in TEMP folder is safe to delete.

Leave a Comment