Re: Invalid access to memory - TSessionData::GetProtocolUrl AND "!" DOES NOT RESOLVE TO FILE NAME
Thanks for your report.
Environment variables resolve in PuTTY command, but not in custom commands.
We never claimed that they do resolve in custom commands.
But you can do
See https://winscp.net/tracker/636
As shown above, the second
Actually, the fact that "some" patterns can even be resolved within the
Particularly the
I've documented this now:
https://winscp.net/eng/docs/custom_command#patterns
There's really no magic behind the
I cannot reproduce this.
I have sent you an email with a debug version of WinSCP to the address you have used to register on this forum.
---
Anyway, to implement, what you are trying to do (executing selected file in PuTTY), you can use an external script file (e.g. PowerShell).
Start here: https://winscp.net/eng/docs/guide_custom_commands_automation
(1) %ProgramFiles% will not resolve. (MINOR ISSUE)
Environment variables resolve in PuTTY command, but not in custom commands.
We never claimed that they do resolve in custom commands.
But you can do
!`cmd.exe /c echo %VARIABLE%`
as a workaround.
See https://winscp.net/tracker/636
(2) The first %TEMP%\putty.txt will not resolve but the second one does. (MINOR ISSUE)
The fact that it resolves the second and not the first is fascinating and should illuminate something for us.
As shown above, the second
%TEMP%
is resolved by the cmd.exe
.
(3) But "!" is supposed to resolve to the file name. (MAJOR ISSUE) It does not.
I tried "./!" but that only does more strange things. "./!" appears to trigger some advanced functionality.
Actually, the fact that "some" patterns can even be resolved within the
!`...`
pattern is undocumented.
Particularly the
!
pattern cannot be resolved.
I've documented this now:
https://winscp.net/eng/docs/custom_command#patterns
Not surprising the native existing &Execute command with "./!" works. You have some other functionality connected with this and
I will assume this is intertwined with this issue.
There's really no magic behind the
./!
. It's a simple !
pattern.
(4) As a side note in my attempt to try everything I also ran into this "!S" issue this generated this report.
In the above command REPLACING "!" > "%TEMP%\putty.txt"` with "!S" > "%TEMP%\putty.txt"` throws INVALID ACCESS TO MEMORY. This is not connected with my needs but interesting nevertheless.
I cannot reproduce this.
I have sent you an email with a debug version of WinSCP to the address you have used to register on this forum.
---
Anyway, to implement, what you are trying to do (executing selected file in PuTTY), you can use an external script file (e.g. PowerShell).
Start here: https://winscp.net/eng/docs/guide_custom_commands_automation