Skip to content

Instantly share code, notes, and snippets.

@devfred
Last active June 6, 2016 18:53
Show Gist options
  • Save devfred/2968400 to your computer and use it in GitHub Desktop.
Save devfred/2968400 to your computer and use it in GitHub Desktop.
Batch: Simple windows batch script example
:: New Project Batch Script
:: @author Frederick King <[email protected]>
:: @date 6/21/2012
::----------------------------------------------
:: hide extra stuff
@ECHO OFF
:: clear the screen
cls
:: Prepare the Command Processor
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
:: get project name
echo Enter project name
set /p name=
:menuLOOP
echo.
echo.= Project Type =====================================
echo.
for /f "tokens=1,2,* delims=_ " %%A in ('"findstr /b /c:":menu_" "%~f0""') do echo. %%B %%C
set choice=
echo.&set /p choice=Choose a project type or hit ENTER to quit: ||GOTO:EOF
echo.&call:menu_%choice%
GOTO:EOF
::-----------------------------------------------------------
:: menu functions follow below here
::-----------------------------------------------------------
:: copy project type into folder with project name
:: xcopy notes<http://technet.microsoft.com/en-us/library/bb491035.aspx>
:menu_1 DotNetNuke Skin
xcopy /s/e/i/exclude:ProjectTemplates\Exclude_Names.txt ProjectTemplates\dnnStarter\dnnSkin %name%
GOTO:EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment