Let me tell you what I have
REM @ECHO OFF
COLOR 1f
REM Delete the output file if it exists from a previous run.
IF EXIST "PingResults.txt" del /q PingResults.txt
REM Delete the temp file.
IF EXIST "pinglog" del /q pinglog
REM Description Header for top row in Excel
ECHO Hostname,Operating System > OSResults.csv
REM Pull hostnames from text file until the end of the text file list
for /f "tokens=* delims=," %%I in (Hostlist.txt) do call :sub1 %%I
goto :eof
:sub1
REM Display in the command window which hostname is being processed so we know
REM something is happening.
ECHO %1
REM Ping the current hostname set as %1 and redirect the output to pinglog file.
"C:\Program Files\Veritas\NetBackup\bin\admincmd\bpgetconfig" -g %1 -L | findstr Release > pinglog
pause
REM Append line of gathered information including the hostname from the source.
REM No spaces so it falls into Excel easier
%*,%pinglog% >> PingResults.csv
REM Delete the temp file.
IF EXIST "pinglog" del /q pinglog
goto :eof
COLOR 1a
CLS
ECHO.
ECHO *********************************************
ECHO *********************************************
ECHO ** **
ECHO ** PROCESS COMPLETED! **
ECHO ** **
ECHO ** The Output Filename is PingResults.txt **
ECHO ** **
ECHO *********************************************
ECHO *********************************************
ECHO.
ECHO.
PAUSE
:END
pause
exit
Till the bold part it is working, it fails to send the data as below
REM Append line of gathered information including the hostname from the source.
REM No spaces so it falls into Excel easier
%*,%pinglog% >> PingResults.csv
What is wrong I am doing there