Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Able to connect to sftp server using GUI but not through batch script

The code generated for "Batch file" format passes commands to WinSCP on its command-line using /command switch. There, % needs to be doubled. While, as the UnableToConnect.txt log file shows, you are using a WinSCP script specified using /script switch. In a WinSCP script, you do not double the %.

So again, I believe you have copied the open command from a code generated for the "batch file" format into a WinSCP "script file", instead of using a code generated for the "script file" format.
TeeLem

Re: Able to connect to sftp server using GUI but not through batch script

I am generating the code for the batch file within the WinSCP gui - Manage, Generate session URL/code - then I select the Batch File format type. The code the gui provides will include two % when converting the unusable characters in the password. When I run my batch scripts, I only need the one % in the password for the converted characters. Using the two will cause the authentication error.
martin

Re: Able to connect to sftp server using GUI but not through batch script

TeeLem wrote:

I found the issue. I am using the script for a batch file which is generated by the GUI. The script converted an & to hex with two %, like this %%26. Apparently, only one % is needed. When I removed the extra %, the batch file worked.

Can you tell us how did you generate that script?
WinSCP uses two %, when generating a batch file only (in a batch file two % are needed). But not when generating a script file - what you are using.
Haven't you copied the open command from a generated batch file into a WinSCP script file?
TeeLem

Re: Able to connect to sftp server using GUI but not through batch script

I found the issue. I am using the script for a batch file which is generated by the GUI. The script converted an & to hex with two %, like this %%26. Apparently, only one % is needed. When I removed the extra %, the batch file worked.
TeeLem

Re: Able to connect to sftp server using GUI but not through batch script

I do not have access to servers as they are operated by outside clients. However, I can ask them to look at the logs if you tell me what they should be looking for.

Thank you!
martin

Re: Able to connect to sftp server using GUI but not through batch script

Do you have an access to server logs? What does it show for these two sessions?
TeeLem

Able to connect to sftp server using GUI but not through batch script

I am able to connect to an sftp server using the GUI interface, but not using a batch file. I have copied the batch file command lines that are generated from the GUI connection. The password does contain characters that are not accepted by WinSCP, but they are converted in the generated batch script.

I am using WinSCP version 5.13, on a windows computer.

I have attached two log files from each connection attempt. I have modified the personal information contained in the files for privacy (username, hostname, ip, etc)

What could be the issue?

Thank you.