problem passing parameters using /parameter param1...

Advertisement

hisnamewasjaan
Guest

problem passing parameters using /parameter param1...

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

Reply with quote

Advertisement

hisnamewasjaan
Guest

Sorry to waste your time...

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

Reply with quote

Apurva Shukla
Guest

4.1.9 documents /parameter use then why?

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,074
Location:
Prague, Czechia

Re: 4.1.9 documents /parameter use then why?

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?

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.

Reply with quote

EMF
Guest

Re: 4.1.9 documents /parameter use then why?

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.)
winscp.exe /console /script=test.txt /parameter Temp
open user:pass@host
ls %1%
'%1%': No such file or directory.

I've tried this on 4.1.8 and 4.2.4beta.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,074
Location:
Prague, Czechia

Re: 4.1.9 documents /parameter use then why?

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

Reply with quote

Advertisement

You can post new topics in this forum