Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 68,024 of 68,980    |
|    Zaidy036 to Andy Ho    |
|    Re: move a fixed number of files between    |
|    11 Mar 23 20:57:13    |
   
   From: Zaidy036@air.isp.spam   
      
   On 3/10/2023 11:55 AM, Andy Ho wrote:   
   > On Sunday, May 7, 2017 at 2:37:12 PM UTC+7, Herbert Kleebauer wrote:   
   >> On 06.05.2017 18:49, hvd...@gmail.com wrote:   
   >>   
   >>>>> Eg: I have a folder A contains 100.000 files. I want to have a   
   >>>>> code that click one time move 5000 files from A to folder 1, 2, ..., 19,   
   20.   
   >>>>   
   >>>> @echo off   
   >>>> set SourceDir=C:\dir1   
   >>>> set TargetDir=C:\dir2   
   >>>> set MaxFiles=100   
   >>>>   
   >>>> set m=0   
   >>>> set n=0   
   >>>>   
   >>>> for /f %%i in ('dir /b /a-d "%SourceDir%\*.*"') do call :sub %%i   
   >>>> goto :eof   
   >>>>   
   >>>> :sub   
   >>>> if not %m%==0 goto :s1   
   >>>> set /a n=n+1   
   >>>> mkdir %TargetDir%\%n%   
   >>>> set m=%MaxFiles%   
   >>>>   
   >>>> :s1   
   I would make a versitile batch using START
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca