I have a Custom Command to send scripts to my cluster queue manager through WinSCP:
qsub -d "!/" "!"
It works great if I don't send more than one work in the same session. That is, if I open WinSCP, send an script and I close WinSCP.
The problem arises when I try to send several scripts in the same session located in different folders. It seems that the !/ pattern is not updated properly, because the first time (and only the first time) I try to send the second script, !/ pattern contains the first folder script and it fails. After that, if I try to send it again, it works without issue. The same happens with another new script. The first time it fails, and after that it works ok because the path is updated.
I tried to delete cache between sendings, enable autorefresh, disable directory cache... and everything with no luck.
You can test it easily creating the following custom command and enabling terminal output:
echo "!/" "!"
If you change between remote folders, you should see that the ! pattern is updated properly, but the !/ pattern doesn't work the first time.
I'm using WinSCP 5.0.7 (Compilation 2268) in Windows 7 32 bits with an SFTP connection.