Ashalshaikh Posted June 9, 2009 Posted June 9, 2009 (edited) Hi My English Is Bad , So I am Sorry .. ;===========Search For a File In a Folder My New Sample Function ..I want Your comments For make it better ..Thanks to senthor For" _FileListTreeToArray UDF" .. I Used In My Function .. For _FileListTreeToArray UDF You Can Found It Hare I Make Tow Functions :It's Search In Only File Name Not In File Path !!expandcollapse popup;_Ash_FileSearch :- ; #FUNCTION# ========================================= ; Name...........: _Ash_FileSearch ; Description ...: Find a File In Some a Folder ; Syntax.........: _Ash_FileSearch($fName, $FindIn, [$FullName = 0,[$tPath = 0]]) ; Parameters ....: $fName - Name Of File Or Part From It. ; $FindIn - Folder You Want Find In It. ; $FullName- 0 = Find Full Or Part In It . 1 = Must Find Full Name ; $tPath - 0 = Return Full Path , 1=Return Path After $FindIn ; Return values .: Success - Return Paths Of Files ; Failure - 0 ; Author ........: Ashalshaikh :: Ahmad Alshaikh ; Modified.......: ; Remarks .......: It is Put Between Paths | ; Related .......: _FileListTreeToArray ; ==================================================== ;_Ash_FileSearchToArray ; #FUNCTION# ========================================= ; Name...........: _Ash_FileSearchToArray ; Description ...: Find a File In Some a Folder ; Syntax.........: _Ash_FileSearchToArray($fName, $FindIn, [$FullName = 0,[$tPath = 0]]) ; Parameters ....: $fName - Name Of File Or Part From It. ; $FindIn - Folder You Want Find In It. ; $FullName- 0 = Find Full Or Part In It . 1 = Must Find Full Name ; $tPath - 0 = Return Full Path , 1=Return Path After $FindIn ; Return values .: Success - Return Paths Of Files ; Failure - 0 ; Author ........: Ashalshaikh :: Ahmad Alshaikh ; Modified.......: ; Remarks .......: ; Related .......: _Ash_FileSearch , StringSplit ; ====================================================oÝ÷ ØLZ^jëh×6#include <Array.au3> ; For Example #include <_Ash_FileSearch.au3> ;~_Ash_FileSearch By Ashalshaikh ;_Ash_FileSearch ==> Example $Result = _Ash_FileSearch("Shell", @WindowsDir) MsgBox(0, "", $Result) ; It Will Find StringInStr In Files Name ,,, And Return Full Path ;##### ;Or $Result = _Ash_FileSearch("Shell.dll", @WindowsDir,1) MsgBox(0, "", $Result) ;It Will Search For Only Shell.dll In Files Name ,,, And Return Full Path ;##### ;Or $Result = _Ash_FileSearch("Shell.dll", @WindowsDir,1,1) MsgBox(0, "", $Result) ;It Will Search For Only Shell.dll In Files Name ,, And Return Path After @WindowsDir ;##### ;========================================= ;~_Ash_FileSearchToArray By Ashalshaikh ;_Ash_FileSearchToArray ==> Example $Result =_Ash_FileSearchToArray("Shell.dll",@windowsDir) For $t = 1 To $Result[0] MsgBox(0, "", $Result[$t]) Next _ArrayDisplay ($Result) ;========================================= ExitThank You All Files :: Tow Functions + Example + _FileListTreeToArrayIn Attachments Ash_File_Search.rar Edited June 9, 2009 by Ashalshaikh
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