Differences

This shows you the differences between the selected revisions of the page.

faq_script_ini 2008-01-17 faq_script_ini 2023-05-19 (current)
Line 1: Line 1:
-====== How do I configure session and/or transfer settings for which there are no script commands? ====== +====== How do I configure site, transfer and/or any other settings for which there are no script commands? ======
-For session settings, you can pre-configure a stored session with all your settings [[ui_login|from GUI]] and open that stored session using ''[[script_commands#open|open]]'' command. For [[transfer_settings|transfer setting]], you can pre-configure your preferred settings as [[ui_pref_transfer|default transfer settings]]. The script uses the default transfer settings as initial.+
-If you want to make your configuration portable, you can store it into an [[config|INI file]] and distribute the INI file with your script.+===== Site Settings ===== 
 +For site settings, you can use ''[[scriptcommand_open#rawsettings|-rawsettings]]'' switch of ''[[scriptcommand_open|open]]'' command.
-For example to enable HTTP proxy use following INI file: +See [[rawsettings|raw site settings]] syntax. WinSCP can [[ui_generateurl|generate the code for you]].
-<code ini+
-[Sessions\Server] +
-HostName=example.com +
-UserName=customer +
-ProxyMethod=3 +
-ProxyHost=proxy +
-ProxyPort=8080 +
-</code>+
-Then, providing the INI file is found and loaded by the WinSCP process running the script, you can use command &quot;open Server&quot; to open the pre-configured session.+===== [[transfer]] Transfer Settings ===== 
 +For transfer settings, use ''-rawtransfersettings'' switch of script commands that transfer files, like [[scriptcommand_put#rawtransfersettings|''put'']], [[scriptcommand_get#rawtransfersettings|''get'']], [[scriptcommand_synchronize#rawtransfersettings|''synchronize'']], etc.
-You can even make a batch file that generates the INI file dynamically based on current context. For example to use value of environmental variable as proxy host name use following batch file:+See [[rawtransfersettings|raw transfer settings]] syntax.
-&lt;code+===== [[global]] Global Settings =====
-echo [Sessions\Server] > server.ini +
-... +
-echo ProxyHost=%PROXYHOST% >> server.ini +
-... +
-winscp /console /script=example.txt /ini=server.ini +
-del server.ini +
-</code>+
-For example, to configure default permissions for uploaded files, use following INI file:+For global settings, use ''[[commandline#rawconfig|/rawconfig]]'' command-line parameter.
-<code ini> +See [[rawconfig|raw configuration]] syntax.
-[Configuration\Interface\CopyParam] +
-PreserveRights=1 +
-Text=rw-rw-r-- +
-</code>+

Last modified: by martin