Кидаешь на форму один FileListBox (вкладка Win 3.1). Вот код:
Код:
var
i:integer;
begin
for i:=0 to FileListBox1.Count-1 do begin
if (FileListBox1.Items.Strings[i]<>'1.txt') and (FileListBox1.Items.Strings[i]<>'2.txt') then
DeleteFile(FileListBox1.Items.Strings[i]);