求写一段批处理(.bat)代码,在当前目录下建立100个文件夹,名称为001到100

如题,谢谢!
2024-11-19 02:01:08
推荐回答(3个)
回答(1):

@echo off
setlocal enabledealyedexpansion
for /l %%i in (1001,1,1100) do (
set dn=%%i
md !dn:~1,3!
)
echo OK!
pause

回答(2):

已测试 可以
@echo off
setlocal EnableDelayedExpansion
for /l %%i in (1001,1,1100) do (
set a=%%i
md !a:~1!
)
echo OK!
pause

回答(3):

@ECHO OFF
FOR /L %%i IN (1001,1,1100) DO (
CALL :MDIR %%i
)
GOTO :EOF

:MDIR
SET A=%1
MD %a:~1,3%
GOTO :EOF