@echo offfor /f "tokens=* delims=" %%i in ('dir /a-d /b /s log.txt') do ( if not exist "e:%%~pi" (md e:"%%~pi) xcopy /h "%%~fi" "e:%%~pi")