New
#61
I decided to search for all *.tmp files and blow them all away, except for the ones flagged as system files. Rebooted the PC and no issues so far
All right, the deed is done. I deleted the 2,713 'tw-' files and left them in Recycle Bin. I then went to Task Scheduler and disabled the 'Logon' task. Then I restarted the computer. No problem so far and no new empty folders. Given the number of people on this forum and the 'expert' on the MS forum who said this wouldn't be a problem, I expect everything to be OK.
The Local folder also contains 4 TMP Files, one starting with 'tmp-' and three starting with 'tw-'. None have a date later than late last year. Anybody know if these can be deleted?
Windows' TEMP/TMP environment variables are there for conforming apps to dump their temporary files in. Well-written apps clean up after themselves. Unfortunately there are a myriad of apps which don't follow Microsoft's guidelines, including Microsoft's own apps, especially those where the developers haven't turned off debugging, hence the zero-byte files and folders which are usually just placeholders in case there's a problem (unless they are quietly using alternate streams [ADS} to conceal data).
However, generally speaking, any .tmp (or, less usually, .temp) file in Windows' default TEMP/TMP locations (C:\Windows\Temp for machine-wide and C:\Users\<username>\\AppData\Local\Temp for logged-on user files) should be deletable unless still held open by the originating process.
If in doubt, restart and try again when the file locks will have been released (unless the originating process also restarts and relocks... that's the risk with always-running background apps).
Note: Many people re-direct the TEMP/TMP environment variable elsewhere, usually to a single location like - for example - C:\Temp. This often makes it easier for startup/logon/logoff/shutdown scripts to clean the folder automatically to prevent any buildup of files and folders that have outlived any usefulness. You can always check for redirection using Win key +r together to open a Run dialog then entering %temp% for the current location of the logged-on user's TEMP/TMP files to be returned.
Hope this helps...
Thanks, RickC. Actually, that's way more detail than I was hoping for. I may leave them alone since it's only 4 files. Is it accurate to say that it's safe to delete ANY temp file as long as the system will let the file be deleted?
TL;DR - I don't think anyone can give a definitive answer to your question. There are no hard and fast rules about how, when and where temporary files are created. It's always a personal decision what's safe to delete.
Did you mean "any file with a .tmp or .temp extension", wherever they are located? Or did you mean "any file, irrespective of its extension, located in just C:\Windows\Temp (machine) and %temp% (user)", i.e. where well-written apps that conform to Microsoft guidelines are supposed to store temporary files?
See the problem? Regrettably there's no hard and fast rules about temporary file creation. For example, some virtualised portable apps create temporary files containing virtualised registry settings (and user preferences)... so if you delete them then either the portable app stops working or it has to recreate them.
I'm one of the people who re-directs both machine and user temporary files to a location of my own choice - C:\Temp. This is just a convenience so I don't have to drill down into two seperate locations to clear out crud.
Nor can I be bothered to plough through what may be a long list of temporary files and folders, some of which end in .tmp/.temp but others which end in .log, .xpi, .mtx or even .txt.
For example, I still use an old version of FrontPage to maintain an HTML page of URLs. Everytime I use FrontPage it generates a wecerr.txt file to tell me it can't find a SharePoint server. Similarly, an absolutely useless zero-byte TWAIN.LOG file gets created by something.
Instead I use a couple of scripts (which I mentioned - with links - in an earlier post in this thread). One deletes empty folders and subfolders older than 5 days (which, in my experience, have always been safe to delete) and the other deletes temporary files using wildcards that I specify. Using my earlier example, wecerr.txt and TWAIN.LOG are two of the entries in the file cleanup script. If the script finds any instances then it deletes them... unless they are still in use. I use these two scripts once a week after logon and before I open any apps. (I have another script that tells me the size of C:\Temp which I run occasionally just to keep any eye on it.)
This way, if I ever make a mistake then it will be my own fault. This approach has worked for me for many years... but may not work for everyone.
Hope this helps...
Thanks again, RickC. Didn't know things were that complicated; should have known better, I guess. I'll be extra careful about deleting temporary stuff.