Post a reply

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)


Topic review


Thank you so much prikryl - URL-encoding the slash and @ symbol worked like a treat. Greatly appreciated! :D


Re: Trying to set username variable in batch script

The set command should be in a wrapping batch file, not in WinSCP script.
But it won't help you anyway. It makes no difference if you specify the username directly or via environment variable.

Solution is to URL-encode the slash and at sign:
open s


Trying to set username variable in batch script

So my server requires the username in the format:

This seems to cause problems when I attempt to put it all on the one line:
open s

So I found another forum post where it is mentioned to use a variable for the username, by adding this line to the script:
set /P USERNAME=""

and then using %USERNAME% for the open script:
open s

When I try to run this it returns 'unknown command 'set'.'

My batch file is just simple:
WinSCP.exe /console /script=script.txt

and contents of script.txt:
option batch on
option confirm off
set /P USERNAME=""
open s
option transfer binary
put test2.txt /

Any help appreciated!