WinScp file transfer automation help
I am trying to send an email on a succeed or a fail from a batch file, my file transfers successfully every time but I always get the error email. Here is my code I am using to perform this. if anyone has any suggestions please let me know. Any help is very appreciated, thanks,
%1winscp /consol /script=%1exp_script.tmp >> Export_LogFile.txt
if errorlevel 1 goto error
echo Success
sendmail.exe -t < %1success_mail.txt
goto end
:error
echo Error!
sendmail.exe -t < %1error_mail.txt
goto end
:deltmp
rem Delete temporary exp_script
del exp_script.tmp
:END
%1winscp /consol /script=%1exp_script.tmp >> Export_LogFile.txt
if errorlevel 1 goto error
echo Success
sendmail.exe -t < %1success_mail.txt
goto end
:error
echo Error!
sendmail.exe -t < %1error_mail.txt
goto end
:deltmp
rem Delete temporary exp_script
del exp_script.tmp
:END