WinScp file transfer automation help

Advertisement

swimlikehell
Guest

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

Reply with quote

Advertisement

DGorthat
Joined:
Posts:
15

Re: WinScp file transfer automation help

Hello swimlikehell,

swimlikehell wrote:

...
%1winscp /consol /script=%1exp_script.tmp >> Export_LogFile.txt
...

winscp.com /console /script=exp_script.tmp >> Export_LogFile.txt

(assuming exp_script.tmp is corect...)

Dirk

Reply with quote

swimlikehell
Guest

The script handles correctly, it uploads my file correctly as it should. but I always get the error email.

Reply with quote

swimlikehell
Guest

here is my output from the upload:

Fri 02/27/2009
03:45 PM
batch on
confirm off
Searching for host...

Network error: Connection timed out.
Searching for host...
Connecting to host...
Authenticating...
Using username "*****".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] *****
/home/OutputFiles
S:\tst.dat | 95 KiB | 96.3 KiB/s | binary | 100%
Session '*****' closed.
No session.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

swimlikehell wrote:


Searching for host...

Network error: Connection timed out.
Searching for host...
Connecting to host...
Authenticating...
Hard to tell without seeing the script. But from the output above I suppose that you have two open commands in the script, where the first one fails.

Reply with quote

Advertisement

You can post new topics in this forum