Thank you Naomi,
But my concern was more on files that would be used be a program later. Thinking again I believe now, that I should no care about it. Whoever puts files in TEMP must be aware that these files can be gone after the program was closed.
So I will set up a process that deletes files in a defined interval from the TEMP dir.
Gerhard
>>Finally found th e reason for my problem:
>>
>>The TEMP dir (%TEMP%) had too many files. I deleted files and all is working fine again.
>>
>>Which leaves as question:
>>
>>How can I automatically delete unnecessary files without "disturbing" programs that rely on one of that files?
>>
>>TIA
>>Gerhard
>>
>Simply add try/catch around delete file, so you'll just log file that can not be deleted and proceed with other deletions.
>
>You can also check if the file is used by first trying to get exclusive access to the file.
Gerhard Schmidbauer
URANUS Software GmbH