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?
This article was posted by VG in following section: Windows 7, Windows Vista, Windows XP.
If you enjoyed this article, you can subscribe to our RSS feed or free newsletter to get all new articles directly in your Inbox. Also check out our most popular articles and archive to read other interesting articles. If you have some news or tip to share, please send us.
creal
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.
Alan
Will the Windows cleanup app and third party cleaners like CCleaner beable to find the newly located Temp folder VG?
Rtyh-12
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)
sasja
this is why I read askvg.com!
can this be done with an bat/reg file, just interrested.
SMBR
interesting thnx
NSDCars5
@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.
Rtyh-12
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
Dave Finster
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.