• TMP files: When can they be safely deleted?

    Home » Forums » AskWoody support » Windows » Windows – other » TMP files: When can they be safely deleted?

    Author
    Topic
    #492928

    In an idle moment, I decided to search my C: drive for *.tmp files. Here’s what turned up:

    As someone who runs CCleaner and Windows 7’s Disk Cleanup utility pretty regularly, I was surprised to unearth so many undeleted tmp files!

    Don’t know for sure, but am guessing that the forty-one WindowsSoftwareDistributionDownload files are leftovers from a Windows Update session. (They’re all dated November 7, 2013, and the update session was aborted halfway through.)

    Of the seven remaining tmp files, four date back to November, and three are just a day or two old.

    Questions:

    1. Are all tmp files created equal?
    2. When is it safe to delete tmp files?
    3. Should I backup these files before deleting them?

    Thanks for your help.

    Brooks

    – – – – – – – – – – – – – – – – – – – – –

    Win 7 Pro, 64-bit

    Viewing 18 reply threads
    Author
    Replies
    • #1434288

      The easiest way to see the tmp files is to go Start, type %temp% then press Enter.

      I use CCleaner as well and after clearing the cache have still found files in there.

      Click on Organize – Select all – Organize – Delete and after the confirmation/delete check the box for Do this for all current items if the only file left is DebugLogFile.txt but you could also run Disk Cleanup as an admin.

      • #1434336

        The easiest way to see the tmp files is to go Start, type %temp% then press Enter.

        The files mentioned by the OP are not in %temp% folder.

        Here’s a discussion on the folder mentioned.

    • #1434333

      Thanks for chiming in, Sudo.

      Following your suggestion, I searched for %temp%. However, my results yielded no files or folders with a .temp extension. Instead, I got files and folders containing the letters “temp” within words, as in: template, tempeh, temple, temperature, tempo, contemplate, etc.

      The same thing happens if I search for *.temp. The search turns up no files with .temp extensions.

      However, a search for *.tmp yields lots of files with a .tmp (or .TMP) extension (as seen in my first post).

      It’s those .TMP files I’m curious about. Most of them are in the C:WindowsSoftwareDistributionDownload folder, and I’m wondering if it’s safe to delete them.

      Again, thanks!

      • #1435238

        Thanks for chiming in, Sudo.

        Following your suggestion, I searched for %temp%. However, my results yielded no files or folders with a .temp extension. Instead, I got files and folders containing the letters “temp” within words, as in: template, tempeh, temple, temperature, tempo, contemplate, etc.

        The same thing happens if I search for *.temp. The search turns up no files with .temp extensions.

        Just to be clear. Sudo15 didn’t tell you to search for %temp% but to enter that as the folder name in the address field of Windows Explorer. It is a system variable that will resolve to the current Temp folder. However, Sudo has overlooked that the TMP files you mention are in a different folder completely — though the mistake is understandable because that is where most of your tmp files will reside.

    • #1434338

      Thanks for the link, Browni.

      What a discussion! A lot of it was over my head, but by the end of the thread, I decided that it was okay to delete old .TMP files from the WindowsSoftwareDistributionDownload folder. I didn’t touch anything else, and backed up the deleted files, just in case.

      So….we’ll see!

    • #1434361

      Most of that discussion thread is irrelevant for your purposes!

      For the last several years I have run occasionally, perhaps weekly, a BATch file which contains
      DEL C:*.TMP /S
      to delete all .TMP files from the system drive.
      That is, all .TMP files except those which are currently in use, each of which gives an “Access is denied.” message.

      It also deletes .TMPLX and .TMPLL files from a couple of truly obscure WinSXS directories, but these seem happily to be recreated by process.

      Be very careful to get the DEL line absolutely correct, otherwise Unhappiness Could Occur…

      BATcher

      Plethora means a lot to me.

    • #1434362

      Running the disk cleanup app, cleanmgr.exe, and choosing the Clean up system files option, will allow to choose a lot of extraneous stuff, including temporary files, memory dumps, windows update leftovers, etc.

      36048-Capture

    • #1434442

      Ruirib’s suggestion of using cleanmgr.exe is the safest and most benign means to remove temp files.
      If it allows you to remove the files in question it is safe.

      Other temp files located in the “User” section may be USEFUL to certain installed applications, but NOT vital.

    • #1434562

      Much obliged for your input, everyone.

      Ruirib, I’ve been running cleanmgr as wingman to CCleaner all along — another reason I was surprised to unearth that nest of old .TMP files. (The Software Distribution Download folder would seem to be off limits to file cleaners.)

      Yesterday, I manually deleted all the old .TMP files from November. No ill effects so far, and I can restore the files if necessary.

      Thanks for posting your .bat script, BATcher. I may or may not have the cohones to use it, but have a blank .bat file ready to roll pending a surge of testosterone. Can I just copy and paste what you’ve posted there? (If I do run the batch file, I’ll image my system first.)

      CLiNT, thanks for the tip. I found no .tmp or .temp files in my “User” folder, save those that are currently in use.

    • #1434722

      BrooksNYC, yes, you can run my BATch file exactly as is, if you want. I spend much of my life running BATch files, which I often prefer to these new-fangled GUI mechanisms, since more automatable.

      You may be slightly confused between %temp%, an environmental variable which points to the “TEMP” directory/folder and .TMP files, which may well be located in the %temp% directory/folder. I can’t remember having come across files with the extension .TEMP (though no doubt someone will say that their hard disk is littered with the things!).

      BATcher

      Plethora means a lot to me.

      • #1434812

        Thanks, BATcher!

        You may be slightly confused between %temp%, an environmental variable which points to the “TEMP” directory/folder and .TMP files, which may well be located in the %temp% directory/folder.

        Not “slightly” confused…..totally confused. So thanks very much for the clarification!

      • #1435128

        BrooksNYC, yes, you can run my BATch file exactly as is, if you want. I spend much of my life running BATch files, which I often prefer to these new-fangled GUI mechanisms, since more automatable.

        You may be slightly confused between %temp%, an environmental variable which points to the “TEMP” directory/folder and .TMP files, which may well be located in the %temp% directory/folder. I can’t remember having come across files with the extension .TEMP (though no doubt someone will say that their hard disk is littered with the things!).

        God love the batch file!!!

        I was writing and using Batch Files before Windows ever reared it’s ugly head.
        I too use a batch file to clean out CRAP, including all .tmp files from my hard drive.
        But there’s a lot more in there besides .tmp files. There is also .Bak files and .Old files and the list just goes on and on. But a properly written Batch File can eliminate all that junk.

        I wrote one batch file that does a file count on the C: drive, then runs several lines to clean out known spots where windows stores Junk Files. Then it makes another file count and displays the difference, representing how many files were actually eliminated. On a PC that’s had NO maintenance, that number can run from just a few thousand to literally Hundreds of Thousands of junk files.

        To keep my PC and the PC’s of my elderly customers clean of junk, I put my everyday Cleanup.bat program in the Startup folder so it runs on every boot up. That keeps the HD pretty clean of junk.
        I call that my “Free Maid Service”. :rolleyes:
        Yeah, it doesn’t get ‘Everything’, but it does keep the junk pile down to a manageable level.
        When I’m doing a thorough cleanup on my own PC, like before doing my weekly C: drive backup, I run a little program called “Temp File Cleaner” (yes, I have a link to it, but I won’t post it here) and also a Retail Program called “Win Utilities”.

        I’ve found over the years (34) that no one program ever gets everything that could be labeled as Junk.
        It takes several Programs and a concerted effort to really Clean UP a PC. It’s what I do for a living, so I’ve gotten pretty darn good at it. 🙂

        Yes, as was already said (thank you) when writing a batch file to delete anything, very special care must be taken to get every letter and character exactly right, or the result can be disastrous.
        MS eliminated my favorite DOS program, “Deltree.exe”. It was not only the most powerful DOS command, but also the most dangerous. It could be like Nitroglycerin in the hand of a child.

        For instance, Deltree /y C:*.* would delete the entire C: drive, and never ask you “Are you Sure?”.

        I do prefer it over “Del” because it’s so powerful, and I’ve found a way to use it in Windows 8.1, with a little trickery. :rolleyes:

        Cheers mates, Keep it clean!
        The Doctor 😎

        • #1435507

          Have been using deltree.exe from the command prompt ever since I have had Win 7 (and long before) with no complications.

          • #1435509

            Have been using deltree.exe from the command prompt ever since I have had Win 7 (and long before) with no complications.

            There aren’t any complications in using the command but an inexperienced user could seriously damage their O/S if the command was used incorrectly.

    • #1435129

      I’m sorry!
      I just had to add this little tidbit:

      The batch file as posted by our English friend,
      DEL C:*.tmp /s

      can be enhanced to look for and delete a whole gaggle of junk files.
      For instance:

      DEL C:*.tmp /s
      DEL C:*.bak /s
      DEL C:*.old /s

      And by specifying a directory to dump, you can get rid of a plethora of junk files.
      Even files that have no specific extension. Like this line to delete everything in the AVG Virus Vault:

      DEL “C:$AVG$VAULT*.*”

      My own Cleanup batch file is over 20 lines long, to get rid of specific files.
      You can even empty your Recycle Bin with a line in a batch file. I do that too.

      Cheers Mates!
      The Doctor 😎

      • #1435141

        I’ve used TFC on this laptop but for some reason or other it crashes the system on another one and both using Win 7 HP SP1.

      • #1435200

        .
        BatchMasters, I bow to you!

        Doc, I ran searches for .bak. and .old files, and it was like opening the door on an overstuffed closet. Lacking the confidence of your elderly customers, I’m kicking the junk back in and slamming the door! (At least, for now.)

        Googling turns up more than one utility called Temp File Cleaner. Were you referring to the addpcs.com version, or Temp File Cleaner by OldTimer? (Am I permitted to ask these questions on this forum?)

        Deltree /y C:*.* would delete the entire C: drive, and never ask you “Are you Sure?”.

        Cautionary note to self: Mustn’t let Deltree /y BrooksNYC.person fall into enemy hands.

        DEL C:*.tmp /s
        DEL C:*.bak /s
        DEL C:*.old /s

        Excellent!

        Grateful thanks to all of you.

        Brooks

        • #1435207

          .
          BatchMasters, I bow to you!

          Doc, I ran searches for .bak. and .old files, and it was like opening the door on an overstuffed closet. Lacking the confidence of your elderly customers, I’m kicking the junk back in and slamming the door! (At least, for now.)

          Googling turns up more than one utility called Temp File Cleaner. Were you referring to the addpcs.com version, or Temp File Cleaner by OldTimer? (Am I permitted to ask these questions on this forum?)

          Cautionary note to self: Mustn’t let Deltree /y BrooksNYC.person fall into enemy hands.

          Excellent!

          Grateful thanks to all of you.

          Brooks

          I suspect that there are more than one “Temp File Cleaner” out there floating around.
          The one I use has a Donald Duck head for an Icon. It cleans out the TEMP folders for all users and then empties the Recycle Bins. The first time I ran it on one old desktop of a friend of mine, it removed 38GB of junk. My friend and I were both amazed at that! That just tends to point up the fact that Windows is a total “Pack Rat” and a very poor house keeper.

          AS far as just what to delete, with a batch file, is up to each individual and may depend on just what programs they run on their computer. My examples were just to show what CAN be done, not to suggest that everyone has to do the same thing that I do. Eh?

          Some people are afraid to delete Anything! I just hope they have a very large hard drive, because they are going to need it! :;):

          I have a shortcut to my little “Temp File Cleaner” on my desktop and I run it just about every day and it’s not uncommon at all for it to take out 2 to 4 megs of temp files, per day. The report of how many meg’s it’s removed only stays on the screen for about five seconds, so you have to look quick or you miss it. 🙂

          Cheers Mates!
          The Doctor 😎

      • #1435201

        DEL C:*.bak /s

        NO!

        I wouldn’t run this one unless you know what you’re doing – and even then only on a few directories, not the whole drive. bak files are backup files, and yes, some of those backups are pretty useless – for example, the automatic backup of word documents that word used to do by default.

        But useful backups made on purpose can also use the .bak extension, and if you delete those, it could come back to bite you, hard.

        DF

        • #1440389

          Bak files are not just used for useful backups. In Word 2007, there are two bak files called OPA12.bak that are essential. If you delete them, Word has to be “reconfigured” which restores them, but that wastes your time when you want to get to work.
          In addition to CCcleaner I also use TempCleaner and ZSoft Uninstaller. TempCleaner gets rid of numerous temporary files that CCcleaner does not, and is completely safe. ZSoft Uninstaller has a Temporary Files deletion option that is the most thorough that I have ever seen, but it may delete files you need to keep. However it does provide a list of the files that it intends to delete so you can choose the right ones. It is best to run ZSoft after running all the other deletion programs so that the ZSoft list will be short and easier to handle.

    • #1435268

      Capisco. Thanks very much, arowland. Except for three .tmp files currently in use, the %temp% folder is empty.

      Another question about .tmp objects….

      The aforementioned WindowsSoftwareDistributionDownload folder contains a gaggle of subfolders with .tmp extensions. Nested within those .tmp subfolders are additional .tmp subfolders with names like:

      $dpx.$.tmp

      Looks .tmp-ish to me, but those .tmp-ish folders all contain hefty .xml files. Based on that fact, am I right to conclude that all .tmp objects (in particular .tmp folders) are not created equal?

    • #1435270

      Has anyone ventured to actually define what a .tmp file is?

      Look up the word “temporary” in the dictionary.

      Coffee grounds are only Temporary, till the coffee is brewed. An egg shell is also Temporary, and of no more use after you’ve eaten the egg.

      Temp files are only of use to the program that created them, that day, and a day or so later are like those old coffee grounds or egg shells, GARBAGE!!!

      Temporary Internet Files are only useful to your browser, while it’s open. Next day, they are GARBAGE, but never go away until someone deletes them. There used to be a setting in I.E. to delete temporary internet files on closing the browser. Most people never set that option and the files will continue to build up on the hard drive till they take over.

      The temporary internet files for Firefox, for instance, do hot have the .tmp extension, so are not found and deleted by most cleanup programs. I found their hiding place and added that folder to my own Cleanup batch file.
      Likewise browsing history, that goes on forever, if you don’t delete it…… but that’s another whole topic.

      A famous man once said “Minus crud is cool” .

      Cheers Mates!
      The Doctor 😎

      • #1435862

        Temporary Internet Files are only useful to your browser, while it’s open.

        Not true. They can still be used to speed up browsing no matter how many times the browser is closed and opened.

        Next day, they are GARBAGE, but never go away until someone deletes them.

        Not true. They can still be used weeks, months or years later; and they can be deleted automatically if the cache fills up.

        There used to be a setting in I.E. to delete temporary internet files on closing the browser.

        There still is, in all versions; but most people don’t use it because it’s unnecessary.

        Most people never set that option and the files will continue to build up on the hard drive till they take over.

        The TIF cache has absolute and recommended maximum size allocation settings which are way below anyone’s free disk space.

        A famous man once said “Minus crud is cool” .

        You’re famous? What for?

        Bruce

    • #1435304

      If you want to *see* what you’ll be deleting before you delete it, replace the “DEL” in “DEL C:*.bak /s” with “DIR”. Always nice to test before jumping in…

    • #1435488

      Neat thread!

      I would be in trouble if deep Microsoft ever gets rid of the command prompt. 😀

    • #1435838

      Let’s not forget that CCleaner has many boxes unchecked by default, especially in its Applications Tab (where you can get rid of all that hidden Firefox garbage mentioned by DrWho). I have researched the boxes I don’t understand, and checked off many which aren’t checked by default, with good results. When used with a recent MS Updates patch in Win 7 which enhances Clean Up System Files in the Disk Cleanup Utility, I have gotten even better results. Just two very safe tools, and I’m happy.

      -- rc primak

    • #1435841

      Bob,

      Do you care to share your research into CC’s unchecked boxes? :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1435846

      Let’s not forget that CCleaner has many boxes unchecked by default, especially in its Applications Tab

      CCleaner also has an “Include” subpanel located under the “options” panel. You can add any file or folder here to add to its regular cleaning cleaning routine. I have added several folders to this “Include” function to get better cleaning results.
      Michael

    • #1437116

      You need to be very careful with the DEL command in batch files. For example, if you want to delete all .tmp files from one folder, then all files from another folder, you might write:

      CD FOLDER1
      DEL *.TMP /Q (do not ask for confirmation each time, you probably don’t want that in a batch file)
      CD FOLDER2
      DEL *.* /Q

      If FOLDER2 did not exist, you would still be in FOLDER1, and the second DEL would then proceed to delete everything from FOLDER1, with no prompt ot warning.

      The better way to write this is

      CD FOLDER1
      IF ERRORLEVEL 1 GOTO NEXT1 (folder does not exist, get out)
      DEL *.TMP /Q (folder does exist, OK to delete)
      :NEXT1
      CDFOLDER2
      IF ERRORLEVEL 1 GOTO NEXT2
      DEL *.* /Q
      :NEXT2
      etc.

    • #1437154

      An even safer way to use the DEL command in a BAT file is with a full path:

      DEL C:Folder1*.TMP /Q

      DEL C:Folder2*.* /Q

      This is simple and not ambiguous.

    • #1556125

      In an idle moment, I decided to search my C: drive for *.tmp files. Here’s what turned up:

      As someone who runs CCleaner and Windows 7’s Disk Cleanup utility pretty regularly, I was surprised to unearth so many undeleted tmp files!

      Don’t know for sure, but am guessing that the forty-one WindowsSoftwareDistributionDownload files are leftovers from a Windows Update session. (They’re all dated November 7, 2013, and the update session was aborted halfway through.)

      Of the seven remaining tmp files, four date back to November, and three are just a day or two old.

      Questions:

      1. Are all tmp files created equal?
      2. When is it safe to delete tmp files?
      3. Should I backup these files before deleting them?

      Thanks for your help.

      Brooks

      – – – – – – – – – – – – – – – – – – – – –

      Win 7 Pro, 64-bit

      27

    Viewing 18 reply threads
    Reply To: TMP files: When can they be safely deleted?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: