Skip to content

Instantly share code, notes, and snippets.

@vicnaum
Created October 28, 2016 19:39
Show Gist options
  • Save vicnaum/28c0c1e91720d681ef259ec1371a73e3 to your computer and use it in GitHub Desktop.
Save vicnaum/28c0c1e91720d681ef259ec1371a73e3 to your computer and use it in GitHub Desktop.
Windows CMD batch file that creates many numbered folders
@echo off
ECHO Usage: manyFolders.cmd yourfoldername 500 3
ECHO (where 500 is number of folders to create and 3 is a number of digits in folder number)
ECHO.
set count=%2
setlocal EnableDelayedExpansion
for /L %%i in (1, 1, %count%) do (
set "formattedValue=000000%%i"
md %1!formattedValue:~-%3!
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment