Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Sorry, I'm not sure what you look for, then.

There's a global settings for WinSCP – the Windows registry. We do not recommend you to use it, as it's easy to break your scripts inadvertently. But if you insist to use it, do it.

Alternatively, you can use the INI file, if you want a shared settings storage for your all scripts isolated from the global registry settings. Yes, INI file can be deleted. But anything can be deleted. What kind of undeletable storage for settings do you have in mind?
Guest

Sorry had to reread your reply, the option is not a command option rather a head of script option, so the example in the documentation would become as below? Tested and that does work.

Unfortunately that will also require an update to a large number of scripts.

It would be good if WinSCP had a global option for scripting in a similar way to the interface, one for the next update perhaps.
winscp.com /ini=nul /command ^
    "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xxxxxxxxxxx...""" ^
    "get examplefile.txt d:\" ^
    "exit"

Becomes
winscp.com /rawtransfersettings ResumeSupport=2 /ini=nul /command ^
    "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xxxxxxxxxxx...""" ^
    "get examplefile.txt d:\" ^
    "exit"
Guest

Still issue with INI file could be deleted, the option to use /rawtransfersettings ResumeSupport=2 is a possibility as that is already in scripts so could update a variable rather than something global.

The setting was used to build up authentication type so can the setting take multiple parameters? i.e. /rawtransfersettings ResumeSupport=2 PreserveTimeDirs=1
martin


  1. Problems with INI file can be usually avoided by setting the INI file read-only:
    https://winscp.net/eng/docs/config#ini_readonly
  2. The command-line switch /rawtransfersettings is not the same as script option -resumesupport. There are likely less places where you would have to change it.
  3. WinSCP script can read WinSCP GUI defaults too. That's what link, I've posted above is about. Please read it. We just strongly do not recommend it, use scripting-specific read-only INI file instead.
silverdollar

Sorry should have mentioned that no INI file is used as INI file use gave other issues such as getting corrupted or deleted.

Am aware of the code to add to the script but want to avoid the requirement for a mass update of scripts.

Is there not a setting somewhere in WinSCP that will turn off the default resume support for scripts? If there is a setting for the interface then why not something for scripts which just call the executable. If there is a default value then surely that can be updated if it can be changed by a parameter in a script (without using an INI file)?

Thanks
martin

Re: How to globally set default Resumesupport=off in all scripts as currently ignoring app setting

You can make your scripts load a shared INI file with contents like:
[Configuration\Interface\CopyParam]
ResumeSupport=2

Alternatively add this to WinSCP commandline:
/rawtransfersettings ResumeSupport=2

See also https://winscp.net/eng/docs/scripting#configuration
silverdollar

How to globally set default ResumeSupport=off in all scripts as currently ignoring app setting

WinSCP Version = 5.19.5

Using WinSCP to put and get files by command line so scripts are used as opposed to calling stored sessions on the Winscp application. In the application the resume support for file transfers is set to disabled so that files are not sent using a partfile so they require a rename once the file has been sftp successfully. This is due to certain 3rd partied not allowing permission to rename files which is normal for companies.

The issue is that when scripting the setting in the app seems to be getting ignored and files are transferring using the partfile method. The way round this is to add an additional switch to the scripts (written in command not PS) -resumesupport=off.

This does resolve the issue but introduces another, there are a large number of scripts and would prefer to not to have to update them all. It would be better to enable resumesupport as the exception rather than the norm.

Is there a way to set the -resumesupport=off for scripts somewhere? This is possible for the app but as mentioned above scripts ignore this setting.

Kind Regards