I need to create folders named 0001 to 1000 using a batch command. Folder names should be all 4 digits, ie: 0001, 0002, 0999 - 1000.
I've already tried this command line:
for /L %%g in (1,1,1000) do (md %%g)
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI need to create folders named 0001 to 1000 using a batch command. Folder names should be all 4 digits, ie: 0001, 0002, 0999 - 1000.
I've already tried this command line:
for /L %%g in (1,1,1000) do (md %%g)
You could also try the following (in a batch file):
setlocal enabledelayedexpansion
for /l %%i in (1,1,1000) do set n=0000%%i& echo !n:~-4!
This gives
0001
0002
0003
...