Loop create template from directory

From Fxp Wiki

Jump to: navigation, search

How to copy some files from a directory into another directory ?

  • Possible use in xmlMind: If you have to create multiple config files (xml, css, catalog, xxe, dtd) each time you start a new project, this is something useful... as long as it changes the variables inside the file as well as the file names: which this doesn't succeed to do yet.
 
rem @echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL DISABLEDELAYEDEXPANSION
echo your choice ? y / n
set /p Input=
md %Input%
for %%a in (example1\*.*) do type %%a > %Input%\%%~nxa
 


  • %%~nxa is a special version of the %%a variable
    • %%a would give the complete adress of the copied file (path and name and extension
    • %%~na would give only the name of the file (without path and without extension)

Date:Apr/04/2008

Personal tools