FileExist() in sub folders

Get help with using AutoHotkey and its commands and hotkeys
shemesh
Posts: 13
Joined: 19 Mar 2019, 16:45

FileExist() in sub folders

21 Apr 2019, 03:23

hi,
i there a way to use FileExist() to find a file in certain folder and all its sub-folders??
Kobaltauge
Posts: 188
Joined: 09 Mar 2019, 01:52
GitHub: MassimoCastell
Location: Germany
Contact:

Re: FileExist() in sub folders

21 Apr 2019, 07:07

You have to search for it. There is a script from Jean Lalonde. It is demonstrated on the webinar from @Joe Glines.
hth

https://www.youtube.com/watch?v=vwlrtgY5N9E
Odlanir
Posts: 531
Joined: 20 Oct 2016, 08:20

Re: FileExist() in sub folders

21 Apr 2019, 07:52

Try this

Code: Select all

filetoSearch := "Dezip.ahk", RootFolder := a_scriptdir
Loop, Files, % RootFolder "\*.*", DR
{
    if ( FileExist(A_LoopFileFullPath "\" filetoSearch) ) {
        filesFound .= "Found in : " A_LoopFileFullPath "`n"
    }
}
MsgBox % filesFound
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, Bing [Bot], Google [Bot], meep0matic and 204 guests