#include <Array.au3>
_filelist(InputBox("", "请输入路径", "", "",50,50))
MsgBox(1,'提示','完毕!')
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
$list = FileFindNextFile($search)
If @error Then ExitLoop
If StringInStr(FileGetAttrib($DirSource & "" & $list), "D") Then
_filelist($DirSource & "" & $list)
Else
$s=StringRegExp(FileRead($DirSource & "" & $list), '类型:(.*)\n简介', 3)
for $i = 0 to UBound($s) - 1
If StringInStr($s[$i], "连续剧") Then
DirMove($DirSource,"C:\连续剧",1)
ElseIf StringInStr($s[$i], "爱情片") Then
DirMove($DirSource,"C:\爱情片",1)
ElseIf StringInStr($s[$i], "恐怖片") Then
DirMove($DirSource,"C:\恐怖片",1)
EndIf
Next
EndIf
WEnd
EndIf
EndIf
EndFunc
|