批处理生成系列文件夹

来源:百度知道 编辑:UC知道 时间:2024/06/21 03:12:38
本人刚接触批处理纯属菜鸟
我想要生成10个文件夹,文件名为 1~10,11~20,21~30……,91~100
写了如下代码:
set a=1
set b=10
:start
if exist 91~100.txt goto over
md %a%~ %b%
set /a a+=10
set /b b+=10
goto start
:end
工作不正常……
请各位老鸟帮忙

另外,能推荐点学批处理的材料就更好了(最好系统点的)
谢了

set a=1
set b=10
set c=0

:start
if "%c%"=="10" goto end
md "%a%~%b%"
set /a a+=10
set /a b+=10
set /a c+=1
goto start
:end

关于学习命令行 ,你可以在运行 cmd 出现dos窗口后,打入:命令 /?
会有帮助出现的。例如:set /?

@echo off&setlocal enabledelayedexpansion
for /l %%i in (1,10,100)do set/a end_num=%%i+9&&md "%%i~!end_num!"