@echo off
set sqlInst=""
if exist test2.txt del tes2.txt
for /F "eol= delims=" %%i in (test.txt) do echo %%i >> test2.txt
for /F "eol= delims=" %%a in (test2.txt) do call :comStr %%a
echo %sqlInst%
pause
:comStr
set tmpStr=%1
echo "Current tmpStr is : "%tmpStr%"
echo ---1-----%sqlInst%-----------
if %sqlInst% == "" (set sqlInst=%tmpStr%) else (set sqlInst=%sqlInst%/%tmpStr%)
echo ---2-----%sqlInst%-----------
goto :eof