>You mentioned deleting "dead" temp files, which I think should be taken care of by a separate maintainance module. In my applications this maintainance module also has options for recreating indexes and similar stuff, which only should be done very rarely.
The reason there are dead temp files is any kind of error. VFP generally cleans after itself on a successful exit. So in case of an error, the app has possibly unable to exit (stuck and needs a bouncer to kick her out of the bar) or has exited prematurely - in both cases a cleanup won't be run. Even if you launch the app again and quit, the cleanup may not be able to clean the previous instance's garbage, as it may still be open.
My strategy is to keep the mess, but keep it small. On a successful exit, I clean anything in the temp folder that's older than three days, one file at a time. The erase {filename} command doesn't complain if it can't erase, so no error handling to worry about.