Archive: how to search files in subdirectory?


how to search files in subdirectory?
how to search files in subdirectory?

search the exe files:

folder " C:\Program Files" i want to search the exe files:

----------Windows Media Player wmplayer.exe
---------WinRAR ...
---------Outlook Express ...


how to stop the loop?


Name "filefind"
OutFile Files.exe
!include "Locate.nsh"






it cannt stop!!! help me thankyou


Section "Search for exe files"
${locate::Open} "C:\Program Files\Windows Media Player" `/L=F /D=0 /M=*.exe /B=1`

$0
StrCmp $0 0 0 loop
MessageBox MB_OK "Error" IDOK close

loop:
${locate::Find} $0 $1 $2 $3 $4 $5 $6

MessageBox MB_OKCANCEL '$$1 "path\name" =[$1]$\n\
$$2 "path" =[$2]$\n\
$$3 "name" =[$3]$\n\
$$4 "size" =[$4]$\n\
$$5 "time" =[$5]$\n\
$$6 "attributes =[$6]$\n\
$\n\
Find next?' IDOK loop
close:
${locate::Close} $0
${locate::Unload}
SectionEnd

The ${locate::Find} command uses $1 to return the full path and name of the *.exe files it finds. After looping through all of the *.exe files it will return an empty string.

One way to exit from the loop is to test $1 and exit when it is empty. You can do this by changing

loop:
${locate::Find} $0 $1 $2 $3 $4 $5 $6

to
loop:
${locate::Find} $0 $1 $2 $3 $4 $5 $6
StrCmp $1 "" close