本帖最后由 风行者 于 2010-9-24 15:42 编辑
未经测试,慎用
#include <File.au3>
#include <Array.au3>
Dim $File[11] = ["123", "456", "单机游戏", "聊天工具", "陪 睡", "0 1", "网络.txt", "sp3.gho", "神 女.txt", "王八蛋_的资料.doc"]
$FileArray = _FileListToArray("d:\")
For $i = 1 To $FileArray[0]
$Index = _ArraySearch($File, $FileArray[$i])
If @error = 6 Then
$Attrib = FileGetAttrib("d:\" & $FileArray[$i])
FileSetAttrib("d:\" & $FileArray[$i],"-"&$Attrib)
If StringInStr($Attrib, "D") Then
DirRemove("d:\" & $FileArray[$i], 1)
Else
FileDelete("d:\" & $FileArray[$i])
EndIf
EndIf
Next
|