I am following the example at https://winscp.net/eng/docs/scripting to automate the transfer of files from my PC to an SFTP server. However each time I try to provide a password for private key, it fails to authenticate.
I am able to use the same password when using the WinSCP graphical user interface and when I explicitly type the password in the command line however not when I automate.
My code looks as follows
I have followed the suggestion at https://winscp.net/eng/docs/session_url to encode special characters hence the %21 which symbolizes an exclamation mark. Interestingly enough the example on the page does not encode the exclamation mark e.g.
I have also tried using
password! and that doesn't work either.