is it possible to attach two forfile commands forfile that I can filter by path and extension , and then run the command only for these files with a double filter?
As an example, I would like to get all the Outlook HTML signatures of all users. I can do it with
forfiles /s /pc:\Users /m *Signatures* /c "cmd /c forfiles /s /p @path /m *.htm"
But this will only display file names, because this default forfiles causes cmd /c echo @file .
Changing this does not work, because then I will need to install /c -option in the internal forfiles command, for which I need to install the command in quotes, which leads to double quotes:
forfiles /s /pc:\Users /m *Signatures* /c "cmd /c forfiles /s /p @path /m *.htm /c "cmd /c echo @path""
How can I escape the internal quotes or use some other approach to run any command for all files filtered by a substring of the path and file extension?
Regards, sc911
[edit] forgot /s for recursive search [/ edit]
source share