Post a reply

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

Guest

Re: WinSCP cannot accept special characters (@ or %) in password

You are right about echo command! It does interpret the % in different way! Thanks a lot for your help! :)
martin

Re: WinSCP cannot accept special characters (@ or %) in password

Possibly the echo shell command interpret the % its own way. Why don't you generate the SFTP_Script.txt directly from JScript?
Guest

Re: WinSCP cannot accept special characters (@ or %) in password

I am using Java to create the stript to synchronize local folder.
The java program takes the password as an input. I have created jar file for the program.

The following is the sample code:
ftpUrl = ftpLoginName + ":" + ftpLoginPass + "@" + ftpDomainUrl;
// Create file
fstream = new FileWriter("SiteExportImport3.cmd");
out = new BufferedWriter(fstream);
out.write("@echo off\r\n" +
"echo option batch on>SFTP_Script.txt\r\n" +
"echo option confirm off>>SFTP_Script.txt\r\n" +
"echo open " + ftpUrl + ">>SFTP_Script.txt\r\n" +
"echo option transfer binary>>SFTP_Script.txt\r\n" +
"echo synchronizelocal "+localDirectoryName+">>SFTP_Script.txt\r\n" +
"echo close >>SFTP_Script.txt\r\n" +
"echo exit>>SFTP_Script.txt\r\n" +
"call \"C:\\Program Files\\WinSCP\\WinSCP.com\" / hostkey=\"XXX\"/script=\"SFTP_Script.txt\">log.txt\r\n" );
out.close();

in the command prompt I execute the jar file with the parameter:
MYFTP.jar password

It works fine when I don't use "%" or "/" in my password

Thanks,
Farhana
martin

Re: WinSCP cannot accept special characters (@ or %) in password

The same. Can you a post a full example of the script command. Also where do you run the command from? Script or command-line (with /command parameter)?
Guest

Re: WinSCP cannot accept special characters (@ or %) in password

martin wrote:

It works for me. What version of WinSCP are you using? Make sure you use the latest version.


Thanks for the quick reply! I am using 4.2.5. It does not take "%" or "/" as password. Could you please tell me which version are you using?
martin

Re: WinSCP cannot accept special characters (@ or %) in password

It works for me. What version of WinSCP are you using? Make sure you use the latest version.
Farhana

WinSCP cannot accept special characters (@ or %) in password

Hi,

I am using WINSCP3. In the script, if I use any special characters(.i.e @), it fails to upload. I am using hexadecimal ASCII code for special character, but still is not working

for an example:

pwd: abcd@123

and I changed to abcd%40123 in the script.

Could someone please tell me what's the correct procedure to use special characters in password in the script?

Many Thanks,
Farhana