Merge multiple subfolders
ulfben Jun 26th, 2017 (edited) 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- ::find all "/needle/"'s under /source/, and merge in /target/clean/needle
- @echo off
- PUSHD %CD%
- SET "needle=home"
- SET "source=%CD%"
- SET "target=%CD%\clean\%needle%"
- FOR /d /r "%source%" %%G IN (*%needle%*) DO (
- ::/E = subfolders, including empty
- ::/NDL = no directory listing. Just summary, pls.
- ROBOCOPY /E /NDL "%%G" "%target%"
RAW Paste Data