本帖最后由 tuutoo 于 2012-3-15 09:28 编辑
我想试着删除以ABC开头的几个文件夹,比如ABC 1、ABC 2、ABC old、ABC new等用下面的命令好像不行啊。
DirReMove("E:\Downloads\ABC*",1)
好像DirReMove不能直接用通配符,就只好考虑查找到后返回名字删除了。
解决了,谢谢大家关注,参考了下这个帖子和帮助:http://www.autoitx.com/forum.php ... B%CE%C4%BC%FE%BC%D0; Shows the filenames of all files in the current directory.
Local $search = FileFindFirstFile("H:\Downloads" & "\ABC*")
; Check if the search was successful
If $search = -1 Then
MsgBox(0, "Error", "No files/directories matched the search pattern")
Exit
EndIf
While 1
Local $file = FileFindNextFile($search)
If @error Then ExitLoop
;MsgBox(4096, "File:", FileGetAttrib("H:\Downloads" & $file))
If StringInStr(FileGetAttrib("H:\Downloads" & $file), "D") Then
DirReMove("H:\Downloads" & $file,1)
EndIf
WEnd
; Close the search handle
FileClose($search)
|