Passing several parameters to script

Advertisement

alberto_grcia
Guest

Passing several parameters to script

I've search through all the posts but still can't figure out what I'm doing wrong (I assume it's my fault, but don't know why).

I just want to be able to pass the ftp url, user and password as parameters to the script; this is how I'm doing it:

On console, I type:

winscp_batch.bat ftp_url ftp_user ftp_password
(ftp_url would be "anyftp.com" (without quotes), etc.)

On the .bat I have:

C:\Apps\WinSCP\winscp.com /script=c:\scripts\ftp_script.txt /parameter %1 %2 %3

And in ftp_script.txt I have:

option batch continue
option confirm off
open ftp://%2%:%3%@%1% -explicittls
lcd...
...

It works well if I use only 1 parameter, but I can't have it working with 2 or 3 parameters.

Could someone please help me finding whay I'm doing wrong?

Thanks.

(please excuse my english; it's not my native language)

Reply with quote

Advertisement

alberto_grcia
Guest

Re: Passing several parameters to script

alberto_grcia wrote:

I've search through all the posts but still can't figure out what I'm doing wrong (I assume it's my fault, but don't know why).

I just want to be able to pass the ftp url, user and password as parameters to the script; this is how I'm doing it:

On console, I type:

winscp_batch.bat ftp_url ftp_user ftp_password
(ftp_url would be "anyftp.com" (without quotes), etc.)

On the .bat I have:

C:\Apps\WinSCP\winscp.com /script=c:\scripts\ftp_script.txt /parameter %1 %2 %3

And in ftp_script.txt I have:

option batch continue
option confirm off
open ftp://%2%:%3%@%1% -explicittls
lcd...
...

It works well if I use only 1 parameter, but I can't have it working with 2 or 3 parameters.

Could someone please help me finding whay I'm doing wrong?

Thanks.

(please excuse my english; it's not my native language)

Ok, solved. As I said it was to be my fault; I was mixing data of several accounts, so the script works well; it was the data I was passing what was wrong.

Reply with quote

Advertisement

You can post new topics in this forum