Results 1 to 5 of 5

Thread: .tmp files wasting space

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    21

    Post

    I'm using VB6's generic Data Report Designer for my report generation, but each time a report is generated, a .tmp file is added to the local computer's Temp Directory. Is there a way to have these .tmp files delete automatically after the Generated report is closed?? Or at any time, for that matter, I just don't want to have to make the user have to go in and delete them by hand to keep it from bogging down their hard-drive.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    If you know the name of the file that's created, just do a Kill for that file name, otherwise Kill all the *.tmp files. The latter this is probably dangerous if the user name is something like Thomas Montgomery Payne and he uses his initials
    Anyhow, put an On Error Resume Next in front of the Kill since some tmp files may be in use.

    ------------------
    Marty



    [This message has been edited by MartinLiss (edited 01-18-2000).]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    21

    Post

    and how would you code a "Kill"?? (sorry, still pretty new at this)

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    The "Kill" statement deletes file(s).

    Code:
    Kill "C:\Windows\Temp\Stuff.tmp"
    It supports wildcards, so to delete all Temp files, type this

    Code:
    Kill "C:\Windows\Temp\*.tmp"
    Use the "On Error Resume Next" statment to stop it complaining if the temp file is in use.

    Regards,

    ------------------
    - Chris
    [email protected]
    If it ain't broke - don't fix it


    [This message has been edited by chrisjk (edited 01-18-2000).]

    [This message has been edited by chrisjk (edited 01-18-2000).]

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Posts
    21

    Post

    thanks Guys, that's all I needed (for now, at least) thanks again.

    Scott

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