Click to See Complete Forum and Search --> : .tmp files wasting space
SME
Jan 18th, 2000, 12:04 AM
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.
MartinLiss
Jan 18th, 2000, 02:58 AM
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).]
SME
Jan 18th, 2000, 05:49 AM
and how would you code a "Kill"?? (sorry, still pretty new at this)
chrisjk
Jan 18th, 2000, 06:00 AM
The "Kill" statement deletes file(s).
Kill "C:\Windows\Temp\Stuff.tmp"
It supports wildcards, so to delete all Temp files, type this
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
chris.kilhams@btinternet.com
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).]
SME
Jan 18th, 2000, 06:33 AM
thanks Guys, that's all I needed (for now, at least) thanks again.
Scott
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.