各位大侠,小弟刚接触批处理不久,最近部门验收,需要做出点东西出来,我做了一个文件复制比较的批处理,从光驱到D盘1目录下,文件比较错误就会出现错误提示,要不就一直COPY,但是我这边想加入一个可以记录次数的命令,由于指令不太熟悉,请大家指教:
@echo off
cls
:copyfile
del /q D:\1\*.txt
copy G:\*.* D:\1
fc G:\*.txt D:\1\*.txt
if errorlevel 1 goto end
goto copyfile
:end
@echo File compare failed.
@echo off
cls
:copyfile
del /q D:\1\*.txt
copy G:\*.* D:\1
fc G:\*.txt D:\1\*.txt
if errorlevel 1 goto end
goto copyfile
:end
@echo File compare failed.
