I have a batch file which retries output from Storage and Switch devices
<pre><code>@ECHO ON
cd C:\Users\gxgopikr\Desktop\Scripts
#pause
plink.exe -ssh admin@10.0.0.34 -pw $h00tm3n0w "show version" &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ############################################################ &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

plink.exe -ssh admin@10.0.0.34 -pw $h00tm3n0w "show int brief" &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ############################################################ &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

plink.exe -ssh admin@10.0.0.34 -pw $h00tm3n0w "show environment" &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ############################################################ &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

plink.exe -ssh admin@10.0.0.34 -pw $h00tm3n0w "show logging log" &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ############################################################ &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt


findstr /i "down error warning" FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt &gt; nul

if errorlevel 1 goto NOD
if errorlevel 0 goto DOWN



:DOWN
{
{

find /i "down" FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt &gt; nul

if errorlevel 1 goto ERROR
if errorlevel 0 goto ONE-DOWN


:ONE-DOWN
{
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo **********Few Interfaces are Down!********** &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

goto ERROR

}


}

:ERROR
{

find /i "error" FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt &gt; nul


if errorlevel 1 goto WARNING
if errorlevel 0 goto ONE-ERROR


:ONE-ERROR
{
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo **********There are errors!********** &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

goto WARNING

}


}

:WARNING

{

find /i "warning" FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt &gt; nul

if errorlevel 1 goto END
if errorlevel 0 goto ONE-WARNING

:ONE-WARNING
{
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo **********There are warnings!********** &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

goto END

}

}

}

{
:NOD
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ***********No Failures!************* &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo. &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt
echo ################################################################## &gt;&gt; FCDCMDS_1A_%date:~-4,4%%date:~-7,2%%date:~-10,2%.txt

goto END

}

:END
</code></pre>

<p>It's perfectly running that my file is calling particular storage array and switch device and executing the command which i have mentioned in the code and saves the output in the text file which i have mentioned in the code, her problem is the output file is not giving in proper way. I need the output with separate lines after command executes and it has to come line by line with neat format.</p>

<p>Please do some modifications on my code and send me the correct code which has to give neat output alignments.</p>