Topic "Passing several parameters to script"

Author Message
alberto_grcia

Guest


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)
alberto_grcia

Guest


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.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License