This is an old revision of the document!
Configuration Storage
WinSCP can store its configuration both to Windows registry and INI file. When installed, the configuration is stored by default into the registry. Portable versions use by default an INI file (if possible). To switch the storage see Storage page of Preferences window.
Note that configuration of restrictions and enforcements by administrator, is always stored in Windows registry.
- Removing Configuration
- Exporting/Backing up the Configuration
- Importing/Restoring Configuration
- Transferring the Configuration
- Registry Key
- INI File Location
- Read-Only Configuration
- Auto-selecting Storage
- Checking What Store Is in Use
- Portable Configuration
- Pre-configuring WinSCP
Advertisement
Removing Configuration
You can clean up all configuration data stored on your machine.
Exporting/Backing up the Configuration
To export/back up your configuration, go to Tools > Export/Backup configuration on Login dialog.
In older versions of WinSCP, use Export button on Preferences dialog.
Importing/Restoring Configuration
To import/restore the configuration, go to Tools > Import/Restore configuration on Login dialog.
See also How do I transfer my settings from a non-working computer?
Transferring the Configuration
To transfer your configuration to another computer/location, export the configuration to an INI file and then import the file on the another computer/location.
Registry Key
If you use registry as configuration storage, the configuration is stored under following key.
[HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2]
Advertisement
INI File Location
When loading configuration, WinSCP first looks for an INI file in the directory, where WinSCP executable is stored in. The INI file needs to have an .ini
extension and the same name as the executable (i.e. WinSCP.ini
). If INI file in not found there, WinSCP looks to application data directory of your user profile, i.e. to C:\Users\username\AppData\Roaming\WinSCP.ini
.
When you opt to use INI file for the first time, WinSCP tries to write it to directory, where WinSCP executable is stored in. If the directory is not writable, INI file is stored to application data directory of your user profile.
You may also use an INI file in a different folder or with a different name using /ini
switch or in preferences.
Read-Only Configuration
Particularly, when using a shared INI file or when pre-configuring WinSCP for a specific task, you may want to set the configuration or its parts read-only.
Read-Only Configuration Sections
In the latest beta version, you can set individual configuration sections read-only. This way you can for example prevent a user from changing default transfer settings, while still allowing other kinds of customizations.
Setting a configuration section read-only makes WinSCP silently discard any changes to that section, when saving the configuration.
An access to individual sections is controlled using an optional Access
key. If the key is not set, a section inherits the state of its parent section. By default, all sections are writable. To set a section read-only, set its Access
key to readonly
. To enable writing to a subsection of a read-only section, set the subsection Access
key to full
.
To change the default state of whole configuration, set root Access
key. In Windows registry, it is a key in WinSCP root registry key. As INI files have no root section, WinSCP looks into a special section named [_]
(a single underscore).
For example the following INI file sets all configuration read-only, with an exception of a host key cache and interface settings (but in turn with an exception of transfer settings, which are again read-only):
[_] Access=read [SshHostKeys] Access=full ... [Configuration\Interface] Access=full ... [Configuration\Interface\CopyParam] Access=read ...
Advertisement
Read-Only INI File
A simpler way to make whole configuration read-only is to use an INI file and set it read-only in a file system. This option is available even in the older versions.
When INI file directory or the file itself is not writable (for example when the INI file is in Program Files
folder or when it is explicitly set read-only), WinSCP does not preserve its state when exiting. No error message is displayed. Only when you explicitly change configuration (such as when you save site, or submit Preferences dialog), an error is shown. You can make WinSCP overwrite a read-only INI file by holding Shift
key, while closing or submitting Preferences dialog.
Auto-selecting Storage
On startup, WinSCP first looks for an INI file in the directory, where WinSCP executable is stored in;1 and then in the user profile directory. If it does not find INI file in either location, it looks for presence of its key in registry (The key is created by installer, so installed WinSCP uses registry by default). If it does not find that either, it creates an empty INI file in the directory, where WinSCP executable is stored in. If that directory is not writable, it creates an empty INI file in user profile directory.
Checking What Store Is in Use
When troubleshooting problems, it is necessary to find whether WinSCP is actually using the configuration storage you intended. For that inspect a beginning of the session log:
-------------------------------------------------------------------------- WinSCP Version 5.15.3 (Build 9730) (OS 10.0.18362 - Windows 10 Enterprise) Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\ Log level: Normal Local account: INTRANET\martin
Tag Configuration
shows either HKCU
Windows registry key or a path to an INI file. When Windows registry configuration storage is in use, it is also important under what Windows account is WinSCP running, to know what account the HKCU
refers to. For that refer to Local account
tag.
Portable Configuration
Learn how to configure WinSCP for portable use.
Pre-configuring WinSCP
Learn how to distribute pre-configured version of WinSCP.
- Unless different location was forced using
/ini
switch.Back
Advertisement