I need to archive all files but not folders that are inside a complex directory structure in a special way. Every subfolder (no matter how deep in the structure) will contain a zip file containing all files that used to be there.
If I use 7zip a -r -tzip files.zip \*.\*
this will put all the structure in a single root file (files and folders). Not good.
The solution is a batch script to recurse this structure, and for every folder found to create a zip file and delete the original files. But I only know how to make simple loops, not unlimited, and not in an unknown directory structure.
For example:
for /F "tokens=1" %%u in ('dir /b /ad parentfolder') do (
only lists the first level subdirectories.