本帖最后由 gzh888666 于 2011-1-19 15:25 编辑 Func delete($current)
Local $search = FileFindFirstFile($current & "\*.*")
While 1
Dim $file = FileFindNextFile($search)
If @error Or StringLen($file) < 1 Then ExitLoop
If StringInStr(FileGetAttrib($current & "" & $file), "D") And ($file <> "." Or $file <> "..") Then
#cs $attrib = FileGetAttrib($current & "" & $file)
$aAttrib = StringSplit($attrib, '', 2)
For $i = 0 To UBound($aAttrib)
$attrib &= '-' & $aAttrib[$i]
Next
FileSetAttrib($current & "" & $file, $attrib & '+N', 1)
#ce
Dirremove($current & "" & $file, 1)
EndIf
delete($current & "" & $file)
WEnd
; DirRemove($current, 1) EndFunc
至于删除自身,Run(@ComSpec&' /c ping 127.0.0.1 -n 3&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE) 只能调用第3方吧?要不怎么执行! |