This is the code i'm using to search for the file i want to be copied.
@echo off
setlocal disableDelayedExpansion
set "src=C:\"
set "dst=C:\test2"
set "search=Web.config"
for /r "%src%" %%F in (*%search%*) do (
set "full=%%~fF"
set "name=%%~nxF"
setlocal enableDelayedExpansion
copy "!full!" "%dst%\!name:%search%=Web.config - Datum - %date:~0,2%-%date:~3,2%- %date:~6,4%-Tijd-%time:~0,2%-%time:~3,2%-%time:~6,2%!"
endlocal
)
But by this it copies all files with web.config in it (like DEFAULT files and COMMENTS files). and i only want the "XML Config' Files.
Someone knows a way around this ?
you might try this:
Change
XMLLine1
for your needs.Please note, this doesn't work with UTF-8/16/… files.