|
-
Jan 18th, 2000, 01:04 AM
#1
Thread Starter
Junior Member
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.
-
Jan 18th, 2000, 03:58 AM
#2
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).]
-
Jan 18th, 2000, 06:49 AM
#3
Thread Starter
Junior Member
and how would you code a "Kill"?? (sorry, still pretty new at this)
-
Jan 18th, 2000, 07:00 AM
#4
PowerPoster
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).]
-
Jan 18th, 2000, 07:33 AM
#5
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|