Archive: how to copy sertain files..


how to copy sertain files..
hi,
how could i copy sertain file types from some directory and from subdirectory at the same time?:eek:


CopyFiles supports the regular syntax like *.exe. You have to use it once for every subdirectory.


jeah, i knew that * means all(i use this allready in the script), but the catch is that i don't know which directories are in that directory that user chooses. example:
CopyFiles /SILENT $Dir1\$FileTypes ${DirToCopy}
user can select each variable by his own. so that i don't even know what directory he is going to choose, don't know which file type he has selected or even the destination folder where to copy all those files. it would be great if there was Recurse into subfolders option what could bee added like this:
CopyFiles /R /SILENT $Dir1\$FileTypes ${DirToCopy}

hope you understood what i was trying to say.


Here's (http://nsis.sourceforge.net/archive/...php?pageid=303) an example of a script that counts subdirs in a dir. You could use it as a template to make your own recursive function...

Dont ask me how though.. Hope you know more about the NSIS language.. I have no clue (I'm just starting).. :(

But I agree, /R should support wildcards.


CopyFiles is a Windows feature that does not support recursive operations.

If you want to include files in the installer you can use the NSIS File command that does support the combination of /R and wildcards.


no, i don't want to include files in the installer, i want installer to copy sertain files from one to an other


link, that Devion refered to doesn't help with this question, because it counts a number of '\' in a given full directory, so that c:\ would give result 1 just like c:\directory, and c:\directory\ would give 2 as a result. it can rather be used somewhere where you need to know number of parent directories, but even then you should know if the directory ends with '\' or not.