Jump to content
Sign in to follow this  
Ashalshaikh

File Search :: Search For File In Folder !

Recommended Posts

Ashalshaikh

Hi

My English Is Bad , So I am Sorry .. :D

;===========

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 !!

;_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)
;=========================================
Exit

Thank You :D

All Files :: Tow Functions + Example + _FileListTreeToArray

In Attachments :P

Ash_File_Search.rar

Edited by Ashalshaikh

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.