Код:
#include <File.au3>
_FileDeleteEx("C:\Folder", "*.*", "|BOOT.INI|NTDETECT.COM|NTLDR|")
Func _FileDeleteEx($sPath, $sMask, $sExclude_List="")
Local $aFiles = _FileListToArray($sPath, $sMask)
For $i = 1 To UBound($aFiles)-1
If $sExclude_List = "" Or Not StringInStr($sExclude_List, "|" & $aFiles[$i] & "|") Then _
FileDelete($sPath & "\" & $aFiles[$i])
Next
EndFunc