//if fileexists('d:\a.txt') then RecycleFile('d:\a.txt' + #0);
// uses shellapi;
function RecycleFile ( sFileName : string ): Boolean ;
var
FOS : TSHFileOpStruct ;
begin
FillChar ( FOS , SizeOf ( FOS ), 0 );
with FOS do
begin
wFunc := FO_DELETE ;
pFrom := PChar ( sFileName );
fFlags := FOF_ALLOWUNDO ;
end ;
Result := ( SHFileOperation ( FOS ) = 0 );
end ;