Results 1 to 17 of 17

Thread: [RESOLVED] Best practice for deleting temp files (not internet cache)

Threaded View

  1. #1

    Thread Starter
    PowerPoster Ellis Dee's Avatar
    Join Date
    Mar 2007
    Location
    New England
    Posts
    3,530

    Resolved [RESOLVED] Best practice for deleting temp files (not internet cache)

    I'd like to delete Windows temporary files in code, and was hoping there was a Windows API call for doing this as opposed to just using Kill or whatever. Unless that's the best way?

    I've been using my own homegrown disk cleanup utility for years now, which deletes unwanted cookies, internet history, url typeahead, and temporary internet files. Plus it empties the recycle bin.

    But I was just poking around my user profile and noticed the following folder:

    C:\Documents and Settings\Ellis\Local Settings\Temp

    This folder currently contains 10,786 files in 49 folders, using up 564 megs. This is surely slowing down my virus scanning if nothing else.

    So I'd like to add the cleaning of that to my disk cleanup routine, but unfortunately it doesn't appear to be enumerated by SHGetFolderPath.

    What is the best way to clear that path?

    EDIT: Also, if there's a system-wide temp directory, as opposed to the user-specific temp files like in the above example, I'd like to be able to clear that too.
    Last edited by Ellis Dee; Jul 1st, 2010 at 05:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width