Topic "Scheduled Task causing script to run under port 22"

Author Message


Hi, I have a a scheduled task that is calling a batch file that opens a simple FTP connection. The task runs fine without any errors and the batch file runs manually without any errors. The FTP profile at the login dialog is set to connect using FTP under port 21. I can open the connection from the user interface. Manually running the batch file opens the connection on port 21 but if the batch file is run by the scheduled task it tries to connect under port 22 and then gets refused by the server. I've recreated the ftp connection but still the same result. Running the task under various accounts all produce the same result.

Is there a way in the script file to force port 21? I read where winscp defaults to port 22 and maybe that's what is causing it. I've tried appending :21 but it will show port 21 in the Host name but the Transfer protocol is still SFTP. Also there is a password for the ftp_user as well but it's not showing as having one in this log.

. 2015-07-02 08:32:19.068 Session name: ftp_user@ftp.******.com (Ad-Hoc site)
. 2015-07-02 08:32:19.068 Host name: ftp.******.com (Port: 21)
. 2015-07-02 08:32:19.068 User name: ftp_user (Password: No, Key file: No)
. 2015-07-02 08:32:19.068 Tunnel: No
. 2015-07-02 08:32:19.068 Transfer Protocol: SFTP (SCP)

Thanks for any help!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
Start here:

If that does not help, please attach a full log file both from scheduled and manual run (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License