ok. something like this should do it:
@echo off
cd /d "c:\startdir"
for /f "tokens=*" %%a in ('dir /a-d /b /s *.*') do move /y "%%a% .
I.e. do a dir listing of all files in all subdirs of the start point - we could make this in different ways, e.g. you could drag a dir onto the batch file on your desktop (in which case make line 2 as:
cd /d %1
and best to do a check:
if X%1==X echo No path supplied & exit /b
Sorry if any typos from phone...
Main Topics
Browse All Topics





by: tricky98Posted on 2009-09-18 at 14:17:17ID: 25370043
you could use the xcopy /e command.
Are all of the "top" level directories in the same place, or do they have a common name?
If all in one place then
xcopy source location destination location /e
if all have a common name then assume on the c drive called something like files001, files002 etc.
xcopy c:\files* desination /e