【语言-批处理】生成文件时,文件名变化生成(例如:yuan1.txt、yuan2.txt、yuan3.txt...)

来源:互联网 发布:servlet获取文本框数据 编辑:程序博客网 时间:2024/05/22 14:57
按123生成文件.bat::set a = 1::for ::if exist %a%.txt() else ( echo 1>1.txt)::if exist *.txt( del *.txt) else ( echo 不存在)::echo %a%>%%a.txt@echo offset lzj=0:beginset /a lzj=%lzj%+1echo %lzj%::if %lzj% == 10 goto endif not exist yufan%lzj%.txt goto endgoto begin:endecho yufan%lzj%>yufan%lzj%.txtexit

清理文件.bat

@echo offif exist *.txt ( del *.txt ) exit


原创粉丝点击