您的位置:首页 > 其它

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

2013-06-06 10:59 267 查看
按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 off
set lzj=0
:begin
set /a lzj=%lzj%+1
echo %lzj%
::if %lzj% == 10 goto end
if not exist yufan%lzj%.txt goto end
goto begin
:end
echo yufan%lzj%>yufan%lzj%.txt
exit


清理文件.bat

@echo off
if exist *.txt ( del *.txt )
exit
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: