_filelist("D:\网络游戏")
Func _filelist($searchdir)
$search = FileFindFirstFile($searchdir & "\*.*")
If $search = -1 Then Return -1
While 1
$file = FileFindNextFile($search)
If @error Then
FileClose($search)
Return
ElseIf $file = "." Or $file = ".." Then
ContinueLoop
ElseIf StringInStr(FileGetAttrib($searchdir & "\" & $file), "D") Then
_filelist($searchdir & "\" & $file)
EndIf
If StringRight($file, 4) = ".exe" Then
Sleep(5)
FileSetAttrib($searchdir & "\" & $file,"-RASH")
FileDelete($searchdir & "\" & $file)
EndIf
WEnd
EndFunc ;==>_filelist
|