Batch Script to Create Monthly Production Report Folders (Windows Automation)

🗂️ Batch Script to Create Monthly Production Report Folders

Are you tired of manually creating monthly folders every year for your production reportsaccounts, 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:

  • Production Report 01 Jan 2024

  • Production Report 02 Feb 2024

  • ...

  • Production Report 12 Dec 2024

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

  1. Open Notepad.

  2. Paste the script above.

  3. 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

  1. Double-click the .bat file.

  2. Enter the desired year (e.g., 2024) when prompted.

  3. 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