如何使用類似批處理得通配符來刪除文件 AU3

admin AutoIt3評論9831字數(shù) 338閱讀模式

簡介

用stringinstr函數(shù),目標字符串中包含給出的字符串一個或以上都會返回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  
文章源自網(wǎng)吧系統(tǒng)維護-http://www.strong-digital.cn/7093.html文章源自網(wǎng)吧系統(tǒng)維護-http://www.strong-digital.cn/7093.html
版權(quán)聲明:文章圖片資源來源于網(wǎng)絡(luò),如有侵權(quán),請留言刪除!!!
廣告也精彩
admin
  • 本文由 發(fā)表于 2021年1月29日 19:58:05
  • 轉(zhuǎn)載請務(wù)必保留本文鏈接:http://www.strong-digital.cn/7093.html
匿名

發(fā)表評論

匿名網(wǎng)友 填寫信息

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