For now, it traverses the directory tree:
for /R %f in (main.css) do @echo "%f"
Actually this does not match the file names. That is, if you have a tree:
DirectoryA A1 A2
the operation for / R will give% f from DirectoryA / main.css, then DirectoryA / A1 / main.css, etc., even if main.css is not in any of these directories. Therefore, to be sure that there really is a file (or directory), you must do this:
for /R %f in (main.css) do @IF EXIST %f @echo "%f"
Also, keep in mind that you need to specify a file name, because if the path or file contains spaces, the directory in which walking can go may explode.
This is at least how it works on Windows 8.
source share