Run(@ComSpec & " /c " & 'del /q D:\1\*.*', "", @SW_HIDE)
或者_filedelete(@ScriptDir&"\backup",'*.jpg',0)
ShellExecute(@ScriptDir&"\backup")
Func _filedelete($path, $ext = '*.*', $flag = 0);_filedelete(路径,[[文件类型],0=不包括子目录,1=包括子目录(当包括子目录时只能用*.*)])
Local $reulst,$abc
If StringRight($path, 1) <> "" Then $path = $path & ""
If $flag = 0 Then
$reulst = FileDelete($path&$ext)
Return $reulst
ElseIf $flag = 1 And $ext = '*.*' Then
$search = FileFindFirstFile($path&$ext)
If $search = -1 Then
Return SetError(2)
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
$abc&=$path&$file&"|"
If FileGetAttrib($path&$file)='D' Then
DirRemove($path&$file,1)
Else
FileDelete($path&$file)
EndIf
WEnd
FileClose($search)
EndIf
EndFunc ;==>_filedelete
|