Topic "WinScp file transfer automation help"

Author Message
swimlikehell

Guest


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
Advertisements
DGorthat
[View user's profile]

Joined: 2009-02-03
Posts: 15
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24556
Location: Prague, Czechia
Please post your script and its output.
_________________
Martin Prikryl
swimlikehell

Guest


The script handles correctly, it uploads my file correctly as it should. but I always get the error email.
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24556
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.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License