Mkdri & Move

July 6, 2009 at 11:54:36
Specs: Windows XP
I need to write a batch script that will take 36,000 files and break them up into 6 folders with 6000 files in each. Any help would be appreciated.

See More: Mkdri & Move

Report •

July 6, 2009 at 13:20:44
If you're not fussy about which go where:

@echo off > newfile & setLocal enableDELAYedexpansion

for %%m in (a b c d e f) do md %%m

set N=
for /f "tokens=* delims= " %%a in ('dir/b/a-d') do (
set /a N+=1
if !N! leq 6000 move %%a a
if !N! gtr 6000 if !N! leq 12000 move %%a b

and so on

If at first you don't succeed, you're about average.


Report •
Related Solutions

Ask Question