Old 17th October 2013, 12:49   #1
happmaoo
Junior Member
 
Join Date: Mar 2009
Posts: 2
Question 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 ...
happmaoo is offline   Reply With Quote
Old 17th October 2013, 13:13   #2
happmaoo
Junior Member
 
Join Date: Mar 2009
Posts: 2
Question how to stop the loop?

code:

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

happmaoo is offline   Reply With Quote
Old 18th October 2013, 13:13   #3
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
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
code:
loop:
${locate::Find} $0 $1 $2 $3 $4 $5 $6


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

pengyou is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump