Skip to content

Instantly share code, notes, and snippets.

@devdrops
Created October 13, 2013 17:55
Show Gist options
  • Save devdrops/6965214 to your computer and use it in GitHub Desktop.
Save devdrops/6965214 to your computer and use it in GitHub Desktop.
File created to implement a loop structure in a bat file to create a basic folder structure while the user still wants to create it.
@echo off
color 0A
title Window Title Goes Here!
cls
:start
echo.
echo ************************************
echo * BAT FILE TO CREATE STRUCTURES *
echo ************************************
echo.
echo Welcome, %USERNAME% :)
:options
echo.
echo.
echo.
echo.
echo What would you like to do?
echo.
echo 1. Start a project (Base Structure Folder)
echo 2. Create a Module (Module Structure Folder)
echo.
echo 0. Close program
echo.
set /p choice="Enter your choice: "
if "%choice%"=="1" goto project
if "%choice%"=="2" goto module
if "%choice%"=="0" goto finish
:project
echo.
echo Starting a project, on the go!
echo.
set /p name="Project name: "
set /p path="Project path: "
echo.
echo Creating "%name%" into "%path%" ...
echo.
echo Done!
goto options
:module
echo.
echo Creating a new Module.
echo.
set /p name="Module name: "
echo.
echo Creating module "%name%" into "modules/%name%" ...
echo.
echo Done!
echo.
set /p confirm="Create a new Module? (Y/N): "
if "%confirm%"=="Y" goto module
goto options
:finish
echo.
echo "Work complete!" - Orc Peon
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment