Section
${Locate} "C:\ftp" "/L=F /M=RPC DCOM.rar /S=1K" "Example1"
; 'RPC DCOM.rar' file in 'C:\ftp' with size 1 Kb or more
IfErrors 0 +2
MessageBox MB_OK "Error" IDOK +2
MessageBox MB_OK "$$R0=$R0"
SectionEnd
Function Example1
StrCpy $R0 $R9
; $R0="C:\ftp\files\RPC DCOM.rar"
MessageBox MB_YESNO '$R0$\n$\nFind next?' IDYES +2
** StrCpy $0 StopLocate ** -> why needs this line?
Push $0
FunctionEnd
请求帮助!
答案 0 :(得分:0)
${Locate}
有一个循环,用于查找与您的输入匹配的文件,以及何时找到一个调用您的回调函数的文件(在本例中为Example1)。它默认搜索子目录,因此可能有多个“RPC DCOM.rar”文件。
如果您只关心第一个文件,那么您可以通过push
将字符串“StopLocate”添加到堆栈来阻止它搜索其他子目录。 Push
其他任何内容都将继续搜索...