failedtocompile Posted July 20, 2010 Share Posted July 20, 2010 Hi Guys, Just enquiring if Autoit can support functions to recursively scan a root folder for targeted file extension say .los, and check File encoding, then output file folder path and encoding type. Example of desired output file. C:\Documents and settings\user123\archives\testing.los [ANSI] C:\Documents and settings\user123\archives\testing123.los [uNI] I have searched the help file and forum posts and have summarised basic functions I would need to use, but this may be completely wrong so any help would be greatly appreciated. FileGetEncoding() FileFindFirstFile() FileFindNextFile() FileGetAttrib() FileWriteLine() FileSelectFolder() _FileListToArray() StringInStr() StringRight() expandcollapse popupDim $FolderName = @MyDocumentsDir Dim $FileCount = 0 ScanFolder($FolderName) ;SendMail() ;CheckEncoding() Func ScanFolder($SourceFolder) Local $Search Local $File Local $FileAttributes Local $FullFilePath $Search = FileFindFirstFile($SourceFolder & "\*.*") While 1 If $Search = -1 Then ExitLoop EndIf $File = FileFindNextFile($Search) If @error Then ExitLoop $FullFilePath = $SourceFolder & "\" & $File $FileAttributes = FileGetAttrib($FullFilePath) If StringInStr($FileAttributes,"D") Then ScanFolder($FullFilePath) Else LogFile($FullFilePath) EndIf WEnd FileClose($Search) EndFunc Func LogFile($FileName) FileWriteLine(@ScriptDir & "\List.txt",$FileName) $FileCount += 1 ;ToolTip($FileName,0,0) EndFunc #cs Func CheckEncoding() $Encode_Type = FileGetEncoding() $PstSearch = FileWriteLine(@ScriptDir & "\filelist2.txt", $PstFile Func SendMail() EndFunc #CE Would anyone have something already created I maybe able to work on? Or any code tips to get me started? Thanks in advance. ftc Link to comment Share on other sites More sharing options...
seandisanti Posted July 20, 2010 Share Posted July 20, 2010 Would anyone have something already created I maybe able to work on?Or any code tips to get me started?Thanks in advance.ftci did a recursive file search a while back (still there somewhere i'm sure) but there were faster ways to accomplish the same goal, like doing a dir/s file mask and having that captured and sorted... search forum for filesearch and you'll see a few ways to skin that particular cat Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now