Код:
@echo off
setlocal enabledelayedexpansion
:checkFile
rem Проверка существования файла.
for %%i in (1,2,3) do (
set /p "fileName%%i=Enter a file name. "
if not exist !fileName%%i! (
copy nul !fileName%%i!
)
)
:mergingFiles
rem Объединение файлов.
set /p "fileMerged=Enter a name of a merged file. "
for %%i in (1,2,3) do (
if not defined fileMerger (
set fileMerger="!fileName%%i!"
) else (
set fileMerger=!fileMerger!+"!fileName%%i!"
)
)
copy %fileMerger% /b "%fileMerged%"
pause>nul
endlocal
exit /b