如何使用类似批处理得通配符来删除文件 AU3

admin AutoIt3评论8351字数 338阅读模式

简介

用stringinstr函数,目标字符串中包含给出的字符串一个或以上都会返回true。

源码

  1. #include <File.au3>  
  2. $Path = "C:\users\ABC\desktop\123\"  ;指定目录,路径自己改 
  3. $FileName = "QvodUpdate5"  
  4. $Files = _FileListToArray($Path) ;获得指定目录下的文件  
  5. For $i = 1 To UBound($Files)-1  
  6.    If StringInStr($Files[$i], $FileName) Then  
  7.    FileDelete($Path & $Files[$i]) ;删除含有$FileName的文件  
  8.    EndIf  
  9. Next  

版权声明:文章图片资源来源于网络,如有侵权,请留言删除!!!
admin
  • 本文由 发表于 2021年1月29日 19:58:05
  • 转载请务必保留本文链接:https://www.58pxe.com/7093.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: