Topic "Defining A Transfer Setting Preset Within A Console Script"

Author Message
Tom Purl

Guest


Hi, I've looked for about an hour for this information, so any help I can get would be greatly appreciated!

I have a custom transfer setting preset that I would like to use from within a console script. I looked at the Scripting/Automation page on the WinSCP wiki, but didn't find any help when it came to specifying transfer setting presets.

Is there a more verbose scripting reference available that tells me how to do this and other things such as comparison criterion?

Thanks!

Tom Purl
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
You cannot use presets from script. Please refer to this FAQ, it may help you sol.ving your problem.
_________________
Martin Prikryl
Tom Purl

Guest


Thanks a ton Martin! I'll try that out.
tom purl
[View user's profile]

Joined: 2006-04-19
Posts: 2
All right, I tried again, but I'm having a few problems.

I set up a default transfer setting preset. When I execute winscp3 using the gui and open the "mysession" session, I get a dialog that tells me that that the "Mydocs Backup" transfer setting preset was automatically selected. This transfer setting preset uses a username mask (myusername).

I can then choose "Commands -> Synchronize", choose my local and remote directories, click on OK, and my local directory is successfully copied to the remote directory.

Now I'm trying to do this via a batch file. Heres's my test.script file:

option batch on
option confirm off

# Set your options
option synchdelete on

synchronize remote "C:\Documents and Settings\myusername\My Documents" "/home/myusername/backups/My Documents"

# Exit WinSCP
close
exit

I then execute this script using the following command:

winscp3.exe myusername@myseerver /console /script=.\test.script

However, when I do this, it's clear that my default transfer setting preset is not being chosen. My default transfer setting excludes anything under the %MYDOCS%\Downloads directory, and this exclusion filter works when using the gui. From the command-line, the files under the Downloads directory are copied.

What am I missing in order to force the command-line to use my default transfer setting preset? Is there a way that I can inspect which transfer setting is being used?

Thanks in advance!

Tom Purl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Again, transfer setting presets are not used in scripts. But you can change the DEFAULT transfer settings via an INI file as is suggested in the FAQ.
_________________
Martin Prikryl
tom purl
[View user's profile]

Joined: 2006-04-19
Posts: 2
prikryl wrote:
Again, transfer setting presets are not used in scripts. But you can change the DEFAULT transfer settings via an INI file as is suggested in the FAQ.


I'm not trying to define a transfer settting preset in the script listed above. I guess my problems is that I don't know how to define the default transfer setting via the ini file. The faq entry to which you refer only has the following regarding default transfer settings:

Quote:
For transfer setting, you can pre-configure your preferred settings as default transfer settings. The script uses the default transfer settings as initial.


It doesn't tell me where to pre-configure my preferred default transfer setting. So then I re-checked your message and saw the following:

prikryl wrote:
But you can change the DEFAULT transfer settings via an INI file as is suggested in the FAQ.


But from what I can see, the faq page that you referenced doesn't show you how to do that. It shows you how to set default security settings and proxy hosts, but nothing about defining a default transfer setting preset.

Which ini file directive am I missing? I tried looking for a more verbose ini file reference for WinSCP, but couldn't find it?

Thanks for all of the help!

Tom Purl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
tom purl wrote:
Which ini file directive am I missing? I tried looking for a more verbose ini file reference for WinSCP, but couldn't find it?

It is not documented (small example is at the very end of the FAQ). Just configure the default transfer settings from GUI. If you want to make sure that the script will behave the same even if you change the setting in GUI in future, make sure that configuration is stored into INI file and make a dedicated copy for the script and force its usage via /ini switch, as is shown in the FAQ.
_________________
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