Great site and appreciate everyone's help in advance, I'm far from a DOS guru but could someone help me with how I can Move the oldest files in a directory first to another folder but only do a certain number of files at a time, for example 20 at a time?
I have an Oracle program parsing xml files but its unable to cope with a huge number of files at the same time (runs out of heap space) so want to move them in small numbers at a time, but the oldest first files first. A simple batch file would be great which I am happy to run as a scheduled task.
Thanks again for any help
@echo off & setLocal EnableDELAYedeXpansion set N=0
for /f "tokens=* delims= " %%a in ('dir/b/a-d/od') do (
set /a N+=1
if !N! gtr 20 goto :eof
move "%%a" somefold
)
=====================================
Helping others achieve escape felicityM2
That's very very helpful. Thank you so much! I appreciate it.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |