找回密码
 加入
搜索
查看: 1623|回复: 2

[系统综合] 如何删除脚本同目录所有文件与文件夹[已解决]

[复制链接]
发表于 2011-1-19 14:48:15 | 显示全部楼层 |阅读模式
本帖最后由 烈火飘云 于 2011-1-25 00:22 编辑

如题:
当然:
Run(@ComSpec&' /c ping 127.0.0.1 -n 3&rd /q/s "'&@ScriptDir&'"',@ScriptDir,@SW_HIDE)
用以上批处理也可以!
但我需要用AU3
谢谢大家
发表于 2011-1-19 15:12:27 | 显示全部楼层
本帖最后由 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方吧?要不怎么执行!
发表于 2011-1-19 15:57:10 | 显示全部楼层
谢谢二楼的同志
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 16:30 , Processed in 0.082640 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表