Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET MailDst=successful_code@mydomain.com
- SET FailMailDst=failed_code@mydomain.com
- SET MailSrc=downloader@mydomain.com
- SET MailSrcName=Automated FTP Process
- SET OKMailSub=Files Have Been Moved
- SET NoFileMailSub=Files Not Present - Maybe Next Time
- SET FailMailSub=An Error Occurred!
- IF EXIST RDCWSCPLog.txt DEL RDCWSCPLog.txt
- SET LOG=RDCWSCPLog.txt
- START /WAIT WinSCP.exe /console /script=WSCP-GetRDC.txt /log=%log%
- IF ERRORLEVEL 1 GOTO erroryes
- IF NOT EXIST "\nt950pa2tcmImportsMobileCapture*.x937" GOTO nofilemail
- GOTO okmail
- :erroryes
- %comspec% /c exit %0%
- FINDSTR /C:"Test_File.ext: No such file or directory" %LOG%
- IF ERRORLEVEL 0 GOTO nofilemail
- IF EXIST %temp%rdcto.txt DEL %temp%rdcto.txt
- FOR %%a IN (%FailMailDst%) DO ECHO %%a>>%temp%rdcto.txt
- "%~dp0sendmail.exe" /TO=%temp%rdcto.txt /FROM=%MailSrcName% ^<%MailSrc%^> /REF=%FailMailSub% /MESSAGE=%log% /HOST=mail.cbbank.com
- GOTO end
- :nofilemail
- IF EXIST %temp%rdcto.txt DEL %temp%rdcto.txt
- FOR %%a IN (%MailDst%) DO ECHO %%a>>%temp%rdcto.txt
- "%~dp0sendmail.exe" /TO=%temp%rdcto.txt /FROM=%MailSrcName% ^<%MailSrc%^> /REF=%NoFileMailSub% /MESSAGE=%log% /HOST=mail.cbbank.com
- GOTO end
- :okmail
- IF EXIST %temp%rdcto.txt DEL %temp%rdcto.txt
- FOR %%a IN (%MailDst%) DO ECHO %%a>>%temp%rdcto.txt
- "%~dp0sendmail.exe" /TO=%temp%rdcto.txt /FROM=%MailSrcName% ^<%MailSrc%^> /REF=%OKMailSub% /MESSAGE=%log% /HOST=mail.cbbank.com
- :end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement