0
@echo off
SET str1=type %1
SET str2=type %2
echo File1: %str1%
echo 
echo File2: %str2%

You probably know what I want but the command line interpreter doesn't. How to do it properly?

PS. I mean the whole content, not only the first line!

Endoro
  • 37,015
  • 8
  • 50
  • 63
0x6B6F77616C74
  • 2,559
  • 7
  • 38
  • 65

1 Answers1

1

For the content (all lines):

@echo off &setlocal enabledelayedexpansion
set "files=1"
if "%~1"=="" set "files="
if "%~2"=="" set "files="
if not defined files echo Missing filename(s^).&goto:eof
:: read the first file
set /a cnt1=0
for /f "usebackqdelims=" %%i in ("%~1") do set /a cnt1+=1 &set "str1!cnt1!=%%i"
:: read the second file
set /a cnt2=0
for /f "usebackqdelims=" %%i in ("%~2") do set /a cnt2+=1 &set "str2!cnt2!=%%i"
:: write the first file
echo File1:
for /l %%i in (1,1,%cnt1%) do echo !str1%%i!
:: write the second file
echo File2:
for /l %%i in (1,1,%cnt2%) do echo !str2%%i!
endlocal
Endoro
  • 37,015
  • 8
  • 50
  • 63