MoveToRecycleBin

Declaration: MoveToRecycleBin (FileMask: string): integer;
The function MoveToRecycleBin moves all files which match der parameter FileMask into the recycle bin and returns the number of deleted files. The parameter FileMask may contain the usual wildcards ? and * in the filename and the extension but not in the path.

Hint: The function MoveToRecycleBin is based on a Windows API call which is reported to be buggy under certain versions of Windows NT. So be careful to apply this function under NT - it could simply delete the files instead of moving them to the recycle bin.