Managing special characters in batch script to write winscp open connection string

Advertisement

ceokep
Joined:
Posts:
1
Location:
italy

Managing special characters in batch script to write winscp open connection string

I'm trying to write the batch code to generate a script into a file, to open a connection with winscp; the final command should be like: open sftp://user:password@example.com/ (without quotes).
The password contain the char + and I must change it into %2B to make winscp undersand.

set pw=mypassword+
::echo %pw% return--> mypassword+
set st=%%2B
::echo %st% return--> &2B
call set pw=%%pw:+=%st%%%
::echo %pw% return--> mypassword2B

I can't find the way to make last call to return %pw%=mypassword%2B (with % before 2B) to pass to winscp script. Can you help me, please? There another strategy (but always in batch dos) to make open winscp command to accept the correct password? Thanks in advance. CeoKep

Reply with quote E-mail

Advertisement

Advertisement

You can post new topics in this forum