Not really going to get into the specifics of what's happening in your particular instances, but another suggestion might be to make use of the RunOnce key in the Registry to delete files the next time Windows starts up. See http://delphi.about.com/cs/adptips1999/a/bltip0799_3.htm for some sample code. However, IMHO Windows itself doesn't keep files open any longer than requested (maybe unless they're DLLs or something). If the file in question is a file opened/used by your application, and Windows tells you it's in use, then I'd strongly suggest your app hasn't closed and released the file handle properly. Cheers, C.
________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Bird Sent: Monday, 30 June 2008 1:37 p.m. To: 'NZ Borland Developers Group - Delphi List' Subject: Re: [DUG] Delete (File) Function ? I have come across similar problems on Windows Servers over the years in a couple of cases: 1 - Data Files (non-database in this case) that have been updated and finished with and closed may remain open or in use as far as the Server goes. Sometimes this times out after a few minutes and the file does become not in use. Sometimes it has to be closed manually on the server (Control panel/Administrative tools/Shared files/Open Files allows one to manually browse and close an open connection). Sometimes even more puzzling is a file remaining with a locked block (a file open for shared read/write) long after the updates have finished. Same solution. Incidentally I discovered There is a useful Windows command line variant of the Administrative Tools GUI - OPENFILES /Disconnect /O Read/Write (+ other options) but haven't yet have had a chance to find out if that only deals with files opened from this workstation or for any workstation or whether it can be used from a workstation to close files on the server. 2 - Zip file archives that get deleted after a time (usually weeks after created) sometimes fail to delete - using the same DeleteFile call as you used. I have not figured out yet why these fail to delete, but they are on a Windows server again. I am most interested to hear anyone shed light on this! John
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe