Knowledge Walls
John Peter
Pune, Maharashtra, India
Things to Know [cont'd]
How to create template file by batch file MS DOS Commands
7161 Views
Template file creation with ms dos commands, has to create program templates with given parameters and bind this parameter dynamically to defined template. This reduces more time to create files or program for software development.

Example program to create java spring controller to with parameters. such as method name, request url and return type esc.,
Example
@echo off
SET /p filename=Enter the filename
SET /p requesturl=Enter the Request URL
SET /p requesturlmethod=Enter the Request URL Method(POST/GET)
SET /p responsetype=Enter the Response Type

echo.        @RequestMapping(value="/%requesturl%",method=RequestMethod.%requesturlmethod%) > %filename%.txt
echo.        public @ResponseBody %responsetype% %requesturl%() throws Exception { >> %filename%.txt
echo.        } >> %filename%.txt

SET /p exit=File is created successfully! (Press any key to exit)
Example with arguments based template file creation
@echo off
REM how to run: runit.bat "filename" "requesturl" "requesturlmethod" "responsetype"

echo.        @RequestMapping(value="/%~2",method=RequestMethod.%~3) > %~1.txt
echo.        public @ResponseBody %~4 %~2() throws Exception { >> %~1.txt
echo.        } >> %~1.txt

SET /p exit=File is created successfully! (Press any key to exit)
Demo 
Previous Topics
Previous lessons of current book.
Logical Operators of MS-DOS Commands
Logical Operators of MS-DOS Commands
Logical Operators of MS-DOS Commands
Relational Operators of MS-DOS Commands
Relational Operators of MS-DOS Commands
Best Lessons of "MS-DOS Commands"
Top lessons which are viewed more times.
Arithmetic Operators of MS-DOS Commands
Arithmetic Operators of MS-DOS Commands
String manipulation of MS-DOS Commands
Relational Operators of MS-DOS Commands
String manipulation of MS-DOS Commands
String manipulation of MS-DOS Commands
Things to Know of MS-DOS Commands
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details