{
FileExists, DeleteFile example
The following code prompts for confirmation before deleting a file.
Create a file and then enter the path and file name in the textfields.
Click the button to delete it.
} 
if FileExists(FileName) then
  if MessageDlg('Do you really want to delete ' + ExtractFileName(FileName) + '?'), mtConfirmation, [mbYes, mbNo], 0, mbNo) = IDYes then 
    DeleteFile(FileName); 
