计算文件数,暂停和移动文件

时间:2013-10-18 09:26:33

标签: batch-file

我想编写1个批处理文件,使其不计算folder1中的文件数,如果该计数等于15,则等待10分钟,然后将所有文件移至folder2

set cmd=“dir /s /b D:\DAILY_FLAT_FILES\inbox\original_files\*.gz |find /c ”\“ ”

1 个答案:

答案 0 :(得分:1)

@echo off
:repeat
for /f %%a in ('dir "folder1\"^| find "File(s)"') do set count=%%a
echo %count%
if %count% leq 15 (
 echo files are 15 or less
 PING -n 601 127.0.0.1>nul
 goto :repeat

)
echo copying the files
copy "folder1\*"  "folder2\"