Trying to set username variable in batch script
Hi,
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:
So I found another forum post where it is mentioned to use a variable for the username, by adding this line to the script:
and then using
When I try to run this it returns 'unknown command 'set'.'
My batch file is just simple:
and contents of script.txt:
Any help appreciated!
So my server requires the username in the format:
www.domain.com/[email protected]
This seems to cause problems when I attempt to put it all on the one line:
open sftp://www.domain.com/[email protected]:[email protected]
set /P USERNAME="www.domain.com/[email protected]"
%USERNAME% for the open script:
open sftp://%USERNAME%:[email protected]
My batch file is just simple:
WinSCP.exe /console /script=script.txt
option batch on option confirm off set /P USERNAME="www.domain.com/[email protected]" open sftp://%USERNAME%:[email protected] option transfer binary put test2.txt / exit