- move a fixed number of files between two directories
- Posted by Tyrser on July 2nd, 2008
Hi all.
I'd like to create a batch file that moves X files from a directory to
another where x is a number;-)
I have a directory with 100000 files and i'd like my script to move 100
files to another dir each time the batch is run.
The goal is to schedule this process so the batch moves e.g. 100 files every
5 minutes untill the source dir is empty.
Any Idea?
Thanks all!
- Posted by foxidrive on July 2nd, 2008
On Wed, 2 Jul 2008 12:10:51 +0200, "Tyrser" <tyrser@nospam.com> wrote:
For which OS?
Do you want to run a process on the 100 files at a time?
- Posted by Richard Bonner on July 2nd, 2008
Tyrser (tyrser@nospam.com) wrote:
*** Here's an XSET solution:
:: 100.bat
:: Moves 100 Files
::
@ECHO OFF
SET LOOP=0
:LOOP
DIR /OD /B | XSET /LINE 1 FILE
MOVE %FILE% whereever
C:\DOS\XSET /MATH LOOP=%LOOP% +1
IF NOT "%LOOP%" == "100" GOTO LOOP
SET LOOP=
SET FILE=
One or more links to XSET can be found at:
http://www.chebucto.ca/~ak621/DOS/Websites.html
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/