24

Am using DELL Inspiron with Windows 7.

As far as I know emptying the windows temp folder would be good. But I faced a strange behaviour around 8 months back, when I clear my windows temp folder. The next day onwards, my laptop starting displaying daily one or other errors and one day OS got crashed. Till now I am not sure whether OS got crashed due to clearing the windows temp folder or something else is problem.

Here Windows temp folder mean "C:\Windows\Temp"

This is the behind the story.

Today, this temp folder "C:\Windows\Temp" contains 102 GB.

Most of the space occupied by the files starts with etilqs_*.*. I came to know that these files are generated due to WD SmartWare.

Now my problem is:-

Actually I want clean up this folder, since it occupies lot of space.

If I clean up "C:\Windows\Temp" folder, will my laptop face the same kind of problem which I faced earlier OR Any new problems will occur?

Please suggest me a good solution.

5 Answers 5

18

As the name implies, the location is intended for files that are only supposed to be stored temporarily.

So, if you write an application and you want to store something for later retrieval, this is the wrong place for you. The Temp location is only to be used for data that, if gone, wouldn't matter anyway.

Sadly, not every programmer understands that concept.

If someone decided to place a critical file in that location, deleting that file might cause a problem to an application.

So, in my personal opinion, deleting the contents of the Temp folder shouldn't cause any problems. But due to the fact of how it is used, it can not be guaranteed to be a safe operation.

Please also keep in mind, emptying the folder while the system in operational could cause a running application to lose a file it placed there. Emptying the folder is something best done during boot.

6
  • Only a very badly written program will close a temp file that contains data it still needs. And if the file is still open, it can't be deleted. So there's simply no chance of losed data that's still needed by doing a blanket delete. The delete simply fails for those files are still in use. Sep 30, 2012 at 3:25
  • @IsaacRabinovitch: So what if I'm running very badly written software? I still might be sad if it crashes :) An application might also place a file there that it needs in the future. Consider application installers that might extract their whole payload to a temporary location before copying the data to the designated location. Sep 30, 2012 at 12:55
  • 1
    So what programs that you know of do this? Sep 30, 2012 at 18:09
  • @IsaacRabinovitch as an example of how some software might easily close this file while still needing it is if a program needs to create a file to pass to another application. There will be a brief period between it closing it and the other application opening it. This may even occur within the same software if something like the office COM library is used
    – mirhagk
    Aug 21, 2015 at 19:07
  • If a file's life cycle is long enough to be opened by two different programs, then it's not a temporary file and shouldn't be in the temp directory. Aug 22, 2015 at 3:35
9

Emptying temp folders seems to be obvious. With most Linux distributions this is done on each boot.
But not with Windows. Why ?
Because some softwares use temp as a reliable storage accross reboot. Yes this is stupid.
Most of those softwares are doing that only after install if they need a reboot. Once done, the files can be wiped out.
Such software are now very rare. I didn't saw any since maybe 2 or 3 years.

So: use a scheduled task run on boot, which delete the content of temp folders, but only for files older than, say, 7 days.
This will do the job safely.

How to delete old files:
https://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days

1
  • A good point made that if you are going to delete temp files then you should only delete those over a number of days old and, in between that period, you should have rebooted. This ensures you don't accidentally delete any temp files in use or waiting to be used at the next reboot.
    – Richard
    Dec 26, 2012 at 15:09
2

As stated by many, it should not be a problem, but honestly just in this week i was trying to 'clean' my pc by Uninstalling programs. to my dismay i couldnt uninstall a bunch because the uninstall depended on files stored in the temp folder(since the installer extracted the setup files there), which i clear regularly.

i have found programs like skype and vmware persistently holding on to files in temp folders, but i dont think they depend on them to function correctly.

once on a server, after clearing the temp folder for 'Administrator' various functions in Sql Server management studio failed because of something that couldnt be found in the temp folder.

just my experience on the bad usage of temp files.

1
  • "uninstall depended on files stored in the temp folder" Seriously?
    – Pacerier
    Jul 29, 2017 at 12:47
1

Deleting of temp files won't create a problem, but instead of deleting the files from the Temp directory, you can use the diskcleanup tool which was provided by Microsoft.

1
  • 2
    Disk Cleanup does not touch the Windows Temp folder on my machine (Windows Vista), no matter what the settings.
    – kreemoweet
    Jun 28, 2014 at 17:32
1

Generally you can't rely on software to be treating the storage as temporary.

For the WD software, see http://community.wd.com/t5/WD-Software/WDsmartware-building-etilqs-files-in-my-windows-temp-folder/td-p/307856

I found that much of the contents of my /Windows/TEMP were .log files and .txt files from Windows and .NET upgrades. I figured I could safely delete them (did a search, recovered over a 1Gb of disk space).

You could also do a search for all files (not directories) last accessed over, say, a week ago and set them to be compressed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .