Every morning when I start work, I need to run the same set of commands to launch my local development servers
and open all the necessary tools. Manually doing this routine became tedious, so I decided to automate it
using Windows batch scripts.
I work with three different projects, each requiring different setup commands:
For each project, I need to:
I created separate
Now instead of manually running all these commands every morning, I simply double-click the appropriate batch file
on my desktop. Each script handles the complete setup for its respective project, saving me time and ensuring
consistency in my development environment.
The Problem: Repetitive Morning Routine
My Development Environment Needs
The Solution: Batch Script Automation
.bat files for each project saved on my desktop. Each script:
React Project Batch Script
@echo off
start cmd.exe /k "cd Projects/react-project && npm run start"
start chrome http://localhost:8080/
code -n Projects\react-projectDjango Project Batch Script
@echo off
start cmd.exe /k "cd Projects && django_virtual_env\Scripts\activate && cd django-project && py manage.py runserver 8000"
start chrome http://127.0.0.1:8000/
start firefox http://127.0.0.1:8000/admin/
code -n Projects\django-projectLaravel Project Batch Script
@echo off
start cmd.exe /k "cd Projects && open -a Docker cd laravel-project && docker compose up -d"
start chrome http://localhost:80/
start firefox http://localhost:8080/phpmyadmin
code -n Projects\laravel-projectThe Result: One-Click Project Setup
How to Create a Windows Batch Script to Start/Run a Server
Disclaimer:
This post was created with the assistance of Gemini and/or ChatGPT for informational purposes. While given a quick look over, readers are encouraged to verify key facts independently.
Comments