WinSCP Batch Script Started Failing. Not sure why.

Advertisement

granitetech
Joined:
Posts:
1
Location:
NY

WinSCP Batch Script Started Failing. Not sure why.

We have a WinSCP batch script that suddenly stopped working. Was hoping someone might have some ideas on possible causes.

We are calling WinSCP in batch mode as:
C:\Program Files (x86)\WinSCP\WinSCP.exe /console /passive=on /script="C:\Program Files (x86)\ftpscript.txt" /log="C:\Program Files (x86)\log.txt"

Here is the contents of our connection script "ftpscript.txt" referenced above that we are calling from a batch script.

### START FTP SCRIPT ###
option batch abort
option confirm off
open ftp://username@mysite.com:mypassword@mysite.com/
option transfer binary
put E:\Path\To\Filename.7z
close
exit
### END FTP SCRIPT ###

Please note the usernames for our FTP server require username@mysite.com format. That's not an error.
Note that I changed the host/user/pass for security reasons.


Here is the log (log.txt) from the FTP session.

2020-01-08 02:31:04.531 Connecting to mysite.com ...
2020-01-08 02:31:04.577 Connected with mysite.com. Waiting for welcome message...
2020-01-08 02:31:04.646 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
2020-01-08 02:31:04.646 220-You are user number 3 of 100 allowed.
2020-01-08 02:31:04.646 220-Local time is now 02:31. Server port: 21.
2020-01-08 02:31:04.646 220-This is a private system - No anonymous login
2020-01-08 02:31:04.646 220-IPv6 connections are also welcome on this server.
2020-01-08 02:31:04.646 220 You will be disconnected after 15 minutes of inactivity.
2020-01-08 02:31:04.646 USER johndoe@mysite.com
2020-01-08 02:31:04.646 500-Unrecognized command format. Please provide user and password information according to
2020-01-08 02:31:04.657 500-the following format:
2020-01-08 02:31:04.657 500- User: [proxy_user:[proxy_passwd:[proxy_token:]]]remote_user
2020-01-08 02:31:04.657 500- Pass: [proxy_passwd:[proxy_token:]]remote_passwd
2020-01-08 02:31:04.657 500
2020-01-08 02:31:19.537 Timeout detected. (control connection)
2020-01-08 02:31:19.537 Connection failed.

Any ideas why it might be failing after the USER command?

Thanks.

John

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
33,665
Location:
Prague, Czechia

Re: WinSCP Batch Script Started Failing. Not sure why.

You will need to contact the server administrator.

Though, did you try removing the hostname from the username?
open ftp://username:mypassword@mysite.com/

Reply with quote

Guest

Hi Martin,

It's a cPanel server, so FTP usernames are always user@hostname.
We tested the script on a local PC and it worked without issue.
Seems to be be occurring subsequent to a Windows update.
We just received another report of a client with the same issue. They just ran Windows updates.

I had them both install the latest WinSCP version today.
Both are still experiencing this issue.
We're seeing the remote connection in the FTP logs .... but it just closes without seeing the login commands.

Any other suggestions?

John

Reply with quote

PeterReed
Guest

Same Trouble using other FTP Clients

I am having this same error "500-Unrecognized command format..." right after the USER commend with other FTP clients (Sorry, not WinSCP.) while connecting to Pure-FTPd server at Bluehost.com. It seems more like a server error.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Same Trouble using other FTP Clients

It's possible that a format of the username has changed.
Contact your hosting provider for an assistance.

Reply with quote

PeterReed
Guest

Re: Same Trouble using other FTP Clients

PeterReed wrote:

I am having this same error "500-Unrecognized command format..." right after the USER commend with other FTP clients (Sorry, not WinSCP.) while connecting to Pure-FTPd server at Bluehost.com. It seems more like a server error.

Turns out this was the result of a firewall blocking the FTP USER command. Not sure why the Pure-FTPd server gave an error response, except maybe it timed out waiting for the USER command that never came. Hopefully this is helpful to someone in the future.

Reply with quote

Advertisement

You can post new topics in this forum