Skip to content
⌘ NSIS Forum Archive

browse folder to modify files

2 posts

tidus25#

browse folder to modify files

Hi
I made a setup that create a tree like that :

folder1
|_folder2
....|_web.config
....|_...
|_folder3
....|_web.config
....|_...
|_folder4
....|_web.config
....|_...


I would like to know if it's possible to browse the folder1 to look for all folder that contain the file web.config because I need to modify a parameter on each files

thx
Animaether#
Check into the FindFirst, FindNext and FindClose commands. You can check whether a found 'file' is a folder by checking for "<foundfile>\*.*" - if that returns true, it's a folder and you can then traverse that again (using a loop or a recursive function). Whenever you find the "web.config" file, adjust it from there.

Also see:


Specifically:


That is a pre-built generic function that lets you search for a file/directory and whenever it finds that file/directory, it calls a callback function; you'd use that function to change the file.