Create a batch file to create folder for each month with month name and days folders in each month folder
To create a batch file that creates a folder for each month with the month name and days folders in each month folder, you can use the following steps:
Open a text editor, such as Notepad, and create a new file.
Type the following commands into the file, replacing "C:\MonthlyFolders" with the path where you want the monthly folders to be created:
Save the file with the
.bat
extension, such asCreateMonthlyFolders.bat
.Double-click the
.bat
file to run it and create the monthly folders and day folders in the specified location.
@echo off
rem Set the base path for the monthly folders
set basePath=C:\MonthlyFolders
rem Create the monthly folders
md %basePath%\January
md %basePath%\February
md %basePath%\March
md %basePath%\April
md %basePath%\May
md %basePath%\June
md %basePath%\July
md %basePath%\August
md %basePath%\September
md %basePath%\October
md %basePath%\November
md %basePath%\December
rem Create the day folders in each monthly folder
for /L %%i in (1,1,31) do md %basePath%\January\%%i
for /L %%i in (1,1,29) do md %basePath%\February\%%i
for /L %%i in (1,1,31) do md %basePath%\March\%%i
for /L %%i in (1,1,30) do md %basePath%\April\%%i
for /L %%i in (1,1,31) do md %basePath%\May\%%i
for /L %%i in (1,1,30) do md %basePath%\June\%%i
for /L %%i in (1,1,31) do md %basePath%\July\%%i
for /L %%i in (1,1,31) do md %basePath%\August\%%i
for /L %%i in (1,1,30) do md %basePath%\September\%%i
for /L %%i in (1,1,31) do md %basePath%\October\%%i
for /L %%i in (1,1,30) do md %basePath%\November\%%i
for /L %%i in (1,1,31) do md %basePath%\December\%%i
Comments
Post a Comment