This is an old revision of the document!

Executables winscp.exe and winscp.com

WinSCP has two executables:

  • winscp.exe: Main executable, supports both GUI and console operation;
  • winscp.com: Console interface tool, supports console operation only, allows input/output redirection.

This follows two basic executable types of Windows operation system, GUI and console.

Both executables are part of the installation package. Both are as well available for portable use.

winscp.exe

The winscp.exe executable is the main one.

What you can do with it:

  • When run, it starts by default in GUI mode, showing the Login dialog;
  • Using the command-line options, it can be started in console mode;
  • It can be used to execute scripts without showing any window (by omitting /console parameter).

winscp.com

The winscp.com executable is a simple tool that internally runs winscp.exe and provides console interface for it. Its primary purpose is scripting.

What you can do with it:

  • Supports console mode only, but allows input/output redirection;
  • When run from another console application (such as standard Windows console/command-line window, i.e. cmd.exe), it inherits its console.1

The .com executable needs the .exe one to operate. It looks for it in the same directory where it is located itself. The .exe must have exactly the same name.

As WinSCP is an Unicode application, you should use a TrueType console font with a full Unicode support, like “Consolas” or “Lucida Console”.

Input/Output Redirection

For input/output redirection use standard operators:

  • > for output redirection;
  • < for input redirection;
  • | for piping.

You can not only redirect normal scripting output and input, but even actual file contents. For that use /stdout and /stdin command-line switches.

You can also use input/output redirection when running winscp.com from another application. For example see Guide to SFTP transfers in .NET. Though for this purpose, consider using WinSCP .NET assembly instead.

Portable Use

Using Portable Executable

WinSCP can be downloaded in the form of standalone Portable executables. The executables in the Portable executables package are identical to the executables in an Installation package. The difference is that the installer pre-configures the executables to override their default portable behavior.

Portable executables are intended for advanced users and specific needs. For general use, use installer.

On startup, the Portable executable looks for an INI file in the directory from which it was started. The INI file must have an .ini extension and the same name as the executable. If the executable does not find any, it creates one with a default configuration. This allows you to easily carry WinSCP with your configuration on a removable media or a USB drive. For details, see auto-selecting configuration storage.

You may also use an INI file in a different folder or with a different name using an /ini switch.

Full Portability

With default configuration WinSCP still stores some temporary data on the file system of the host computer. You can configure WinSCP to be completely portable though, i.e. make it store all its files and configuration in one place – for example, a portable USB drive.

WinSCP stores by default these files to the host computer:

You can force WinSCP to store the files into different locations in preferences. You can use local paths relative to the WinSCP start folder.

To change the storage directly in an INI file, to the same locations where WinSCP is started from, set following parameters:

[Configuration\Interface]
RandomSeedFile=.\winscp.rnd
DDTemporaryDirectory=.\temp\
  1. winscp.exe /console would pop up in new console window.Back

Last modified: by 2.191.224.228