是不是这样的?
_filelist("D:\jhwl")
;=====================www.autoitx.com===========
;Author:jhwl
;$DirSource 搜索路径
Func _filelist($DirSource)
If FileExists($DirSource) = 0 Then
MsgBox(64, "提示", "【" & $DirSource & "】目录不存在!请重新指定有效目录.")
Else
Local $WorkingDir, $search, $file
FileChangeDir($DirSource)
$search = FileFindFirstFile("*.*")
If $search = -1 Then
;MsgBox(64, "完成提示", "在目录【" & $DirSource & "】下未找到任何文件和子目录!")
Else
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
If StringInStr(FileGetAttrib($DirSource & "\" & $file), "D") Then
_filelist($DirSource & "\" & $file)
Else
;MsgBox(0, 000, $DirSource & "\" & $file)
FileWriteLine(@ScriptDir&"\file.txt", $DirSource & "\" & $file & @CRLF)
EndIf
WEnd
EndIf
EndIf
EndFunc
|