Topic "problem passing parameters using /parameter param1..."

Author Message
hisnamewasjaan

Guest


Hi
I'm trying to do something I would have thought was simple

WinSCP.exe /console /script=copyToP4.txt /parameter target\APReporting.war

And in copyToP4.txt at some point I have:

put %1%

but the console always says:

File or folder '%1%' does not exist.

So it seems that the parameter is not being resolved? What am I missing?
My WinSCP version is 4.0.4 (build 346).

Thanks Jan
Advertisements
hisnamewasjaan

Guest


It seems the WinSCP version I was using did not support /parameter.
Upgrading to 4.2.3 resolved my problem.
/jan
Apurva Shukla

Guest


The latest stable release has the use of /parameter then why is that the script cannot be passed any arguments.

I have a scenario where I have to write a script where I log onto a server, check the directory listing. Choose which files to pick up and then download them on a regular basis.

WinSCP ver 4.1.9 is however causing many problems in this small effort.
a) it would not let me pass parameters to script. The documentation contains not one single working example.
b) It wont accept hostkey automatically. I know there are security issues, but I have to log onto 400 machines in a loop and pick out select files from them.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Apurva Shukla wrote:
a) it would not let me pass parameters to script. The documentation contains not one single working example.

What about this one?

Quote:
b) It wont accept hostkey automatically. I know there are security issues, but I have to log onto 400 machines in a loop and pick out select files from them.

It does, use -hostkey switch.
_________________
Martin Prikryl
EMF

Guest


Quote:
What about this one?


I am having a similar issue: testing a very simple script and it also insists on inserting %1% into the ls statement: (Pardon the paraphrasing on results; I don't have the window in front of me at the moment.)
Code:
winscp.exe /console /script=test.txt /parameter Temp

Code:

open user:pass@host
ls %1%

'%1%': No such file or directory.

I've tried this on 4.1.8 and 4.2.4beta.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
EMF wrote:
I've tried this on 4.1.8 and 4.2.4beta.

It works since 4.2.2 only. So it should work with 4.2.4. Please post your complete script and output of the console running it.
_________________
Martin Prikryl
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