Move 100 files at a time

Microsoft Windows xp professional sp2 w/...
January 24, 2010 at 23:07:31
Specs: Windows Server 2003
Hi ,

I have Moving some files with different extensions from folder A to Folder B using the MOVE command,these two folders are in two differnt drives.

Due to space issues in Folder B I have to MOVE the files in batches..like I have to MOVE the first 100 files from folder A to Folder B..then the next 100 files and so on..

In my previous batch script i used MOVE *.* FolderB..now how can i limit my MOVE commnad to 100 files per execution.

Thanks, Mora


See More: Move 100 files at a time

Report •


#1
January 25, 2010 at 01:34:54
@echo off & setLocal EnableDELAYedeXpansion
set N=
for /f "tokens=* delims= " %%a in ('dir/b/a-d') do (
set /a N+=1
if !N! lss 101 move "%%a" folderB
)


=====================================
Helping others achieve escape felicity

M2


Report •
Related Solutions


Ask Question