Findfirst/next issue
Hi,
I am attempting to locate 2 subfolders within a given path and output them to a text file.
The problem i have is locating the second subfolder.
For example :
The full path is
c:\top\mid\parent\child
I already know the c:\top\mid but subfolders parent and child will have different names depending on configuration within a 3rd party application.
Using findfirst i can locate and register the folder 'parent'. I append this to a text file with the original path and search again but this time find nothing.
I have even tried to split the searches into 2 seprate functions - only the parent function returns a result.
Obviously - in testing this i know for sure that folders parent and child exist.
I think it must be something really simple but i just cant see what it is. Function child returns a blank result - not an errorParent
$2"
ClearErrors
FindFirst$0 $1 "C:\top\mid\*.*"
>StrCmp $1 "." +2
StrCpy$2 "$1$\r$\n"
>loop:
>FindNext $0 $1
IfErrors end
StrCmp$1 ".." loop
StrCpy$2 "$2$1$\r$\n"
>goto loop
end:
>StrCmp $2 "" 0 +2
MessageBox MB_OK"Error! No Files found" IDOK +2
MessageBox MB_OK "Files found: $\r$\n$2"
>FileOpen $9 C:Path1.txt w
FileWrite$9 "C:\top\mid\"
FileWrite $9 "
FileClose $9
FindClose $0
FunctionEnd
Function Child
ClearErrors
FileOpen $3 C:\Path1.txt r
FileRead $3 $4
Messagebox MB_OK "$4"
FindFirst $0 $1 "$4*.*"
StrCmp $1 "." +2
StrCpy $2 "$1$r$n"
loop1:
FindNext $0 $1
IfErrors end
StrCmp $1 ".." loop1
StrCpy $2 "$2$1$r$n"
goto loop1
end:
StrCmp $2 "" 0 +2
MessageBox MB_OK "Error! No Files found" IDOK +2
MessageBox MB_OK "Files found: $r$n$2"
FunctionEnd
>
Can anyone see where i am failing ?
Thanks
Fish