đ️ Batch Script to Create Monthly Production Report Folders
Are you tired of manually creating monthly folders every year for your production reports, accounts, or project tracking? You can automate the process in seconds with a simple Windows batch file!
In this tutorial, I’ll show you how to write a .bat file that asks for a year and then creates 12 folders—one for each month—with names like:
This is especially useful for small businesses, manufacturers, accountants, or anyone organizing reports on a monthly basis.
✅ Why Use a Batch File?
Saves time – No need to create folders manually.
Consistent folder names – Avoid typos or inconsistent formatting.
User input – Lets you enter any year (e.g., 2024, 2025).
đ ️ Step-by-Step Guide
đ 1. Copy the Script Below
@echo off setlocal enabledelayedexpansion :: Ask for year set /p year=For which year do you want to create folders? :: Month names set months=Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec :: Loop through 1 to 12 set i=1 for %%M in (%months%) do ( if !i! LSS 10 ( set folderName=Production Report 0!i! %%M %year% ) else ( set folderName=Production Report !i! %%M %year% ) echo Creating "!folderName!" mkdir "!folderName!" set /a i+=1 ) echo All folders created for %year%. pause
đš 2. Save the Script
Open Notepad.
Paste the script above.
Save the file with a
.bat
extension.
Example:create_monthly_folders.bat
Make sure to select "All Files" in the "Save as type" dropdown and not .txt
.
đš 3. Run the Batch File
Double-click the
.bat
file.Enter the desired year (e.g.,
2024
) when prompted.The script will create 12 folders in the same directory.
You’ll see folders like:
Production Report 01 Jan 2024
Production Report 02 Feb 2024
...
Production Report 12 Dec 2024
đ¯ Use Cases
Monthly Production Reports
Accounts and Billing folders
Project Documentation by month
Employee Records
Client Deliverables
đ§ Tips
You can modify
"Production Report"
to suit your needs (e.g.,"Monthly Sales"
or"Invoices"
).Want to change the folder location? Add
cd
to change directory before the loop.
No comments:
Post a Comment