Help
Hi All,
im trying to run a batch file and automate it in task scheduler, if i run the batch file on its own it runs fine, as soon as i run it in task scheduler it fails to sendmail like in the batch file.
below is my batch file and script file.
****Batch File****
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=c:\batch\getmyfile.txt
if errorlevel 1 goto error
echo Success
sendmail.exe -t < success_mail.txt
goto end
:error
echo Error!
sendmail.exe -t < error_mail.txt
:end
****Script File****
open ftp://###%40#####.com.au:#############H@######.com.au/
cd /
lcd C:\batch\getmyfile
get -delete getmyfile.txt
exit
# Execute the script using a command like:
# "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\writable\path\to\log\WinSCP.log" /ini=nul /script="C:\path\to\script\script.txt"
im trying to run a batch file and automate it in task scheduler, if i run the batch file on its own it runs fine, as soon as i run it in task scheduler it fails to sendmail like in the batch file.
below is my batch file and script file.
****Batch File****
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=c:\batch\getmyfile.txt
if errorlevel 1 goto error
echo Success
sendmail.exe -t < success_mail.txt
goto end
:error
echo Error!
sendmail.exe -t < error_mail.txt
:end
****Script File****
open ftp://###%40#####.com.au:#############H@######.com.au/
cd /
lcd C:\batch\getmyfile
get -delete getmyfile.txt
exit
# Execute the script using a command like:
# "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\writable\path\to\log\WinSCP.log" /ini=nul /script="C:\path\to\script\script.txt"