Come to think of it. I would be very wary of deleting your Temp folder while Windows might be using - you might be trying to drag the rug from under it's feet ;-)
Create another test folder, and try it instead... Cheers, C. -----Original Message----- From: [EMAIL PROTECTED] [mailto:bigal@;xtra.co.nz] Thanks but it invokes an error message: 'Cannot delete file:cannot read from the source file or disk' Would this have anything to do with WinXP administration rights? Although I can delete all manually OK. Alistair+ procedure TForm1.FormShow(Sender: TObject); var R: TShFileOpStruct; foldername:string; begin foldername:='c:\temp'; [snip] --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/