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: Powershell script

I'm confused.

  1. There's no !P in your command.
  2. If you do not check "Remember session password and pass it to PuTTY (SSH)", the password won't be passed at all. If you check it, you claim that it is passed "correctly". So when is it passed incorrectly?


Note that if you check "Remember session password and pass it to PuTTY (SSH)", but do not include !P in the command, WinSCP passes -pw password as the first argument of the program (WindowsTerminal.exe in your case). So the behaviour is as expected in that case. In your case, you need to explicitly use -pw "!P" to designate a correct placement of the password in the command.
See https://winscp.net/eng/docs/ui_pref_integration_app#password

If the problem are the special characters, as discussed by the topic you have linked, then I do not understand the point of your post. The other topic shows that it's a problem of PuTTY, not WinSCP.

Though, it might be worth trying WinSCP 6.2, as it can pass the password to PuTTY using named pipe instead of commandline. It might help, at least with some special characters (like quotes).
Again, see https://winscp.net/eng/docs/ui_pref_integration_app#password
petr3

PowerShell script

Funny thing is, when I select "Remember session password and pass it to PuTTY (SSH)", the password is passed correctly, but it's placed before even invoking (in my case) powershell – see the attachment.
Do someone know if I can modify my invoking command so I can make use of the password passed this way?
This is my PuTTY/Terminal client path:
%ProgramFiles%\WindowsApps\Microsoft.WindowsTerminal_1.18.3181.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe powershell %USERPROFILE%\Documents\winscp.ps1 -rpath1 '!/' -host1 '!@' -user1 '!U' -port1 '!#' -key1 '!K' -name1 '!N'

The red rectangle is the password to SSH connection.
petr3

3yo issue still a problem

Hello, I've lost like 2 days trying to solve my script, but it seems I experienced this bug:
WinSCP is able to login but passes wrong/no password to PuTTY
Is there a possibility to fix this?

With simple password user the !P parameter works fine, but with the password with some special chars the parameter is empty.

Thanks ;)