moving old directories..

Microsoft XP
January 23, 2009 at 03:06:35
Specs: Windows XP, Intel
Hi ,

I want to write a batch file to move all directories except last two created.

In Detailed:-

" dir /b/o:-d " ---> command will return list of dir/file names based on creation date. I want to keep first two from this list and remaining i want to move to other location.

Could someone please give me the batch script to do it.

Thanks & Regards

See More: moving old directories..

Report •

January 25, 2009 at 01:11:41
You've already done half the work, why stop there? (Untested)

for /f "skip=2 delims=" %%a in ('dir /b/o-d/ad') do move "%%a" "dest"

Report •
Related Solutions

Ask Question