Код:
![Выделить весь код](images/misc/selectcode.png)
@echo off
set quantity=5
set "source=D:\Work\138"
set "destination=D:\Work\139"
for %%i in ("%source%\*") do (
set /a count+=1
for /f %%j in ('
set /a count
') do (
if %%j leq %quantity% (
move "%%i" "%destination%">nul
) else (
exit /b
)
)
)
exit /b
или
Код:
![Выделить весь код](images/misc/selectcode.png)
@echo off
set quantity=5
set "source=D:\Work\138"
set "destination=D:\Work\139"
for /f "delims=" %%i in ('
dir /a-d/b/on "%source%" 2^>nul
') do (
set /a count+=1
for /f %%j in ('
set /a count
') do (
if %%j leq %quantity% (
move "%source%\%%i" "%destination%">nul 2>nul
) else (
exit /b
)
)
)
exit /b
.