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

Author Message
Farhana

Guest


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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
It works for me. What version of WinSCP are you using? Make sure you use the latest version.
_________________
Martin Prikryl
Guest




prikryl 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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
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




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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
Possibly the echo shell command interpret the % its own way. Why don't you generate the SFTP_Script.txt directly from JScript?
_________________
Martin Prikryl
Guest




You are right about echo command! It does interpret the % in different way! Thanks a lot for your help! Smile
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