WinSCP Script Commands: A Practical Reference for Automation
Publication Date:
Updated:
INFORMATION > WinSCP Script Commands: A Practical Reference for Automation
Bottom line: Start a session with a verified open command, set local and remote working directories explicitly, transfer with get, put, or synchronize, and finish with exit. Test destructive options on disposable data first.
What you'll learn
- What the most common WinSCP script commands do and which side of the transfer they affect.
- How command masks, paths, confirmations, and delete options can change results.
- Why credentials in
open username:password@hostare unsuitable for maintained automation.
Who this is for: Operators reading or reviewing a WinSCP command script.
2026 context: The original command list remains a useful orientation, but current syntax and security options belong in the official reference. Pin host keys, protect secrets, and review commands that delete, overwrite, or synchronize files.
Overview
This is about commands commonly used in WinSCP. I hope this is helpful to see what WinSCP commands can do.
Table of Contents
1. Frequently used commands
1-1. open
Connection command. Rather than being used frequently, it is the first command that is always executed in WinSCP commands.
It is executed with "open username:password@IP address".
Many servers will use key authentication to log in, and the privatekey option is required in such cases.
1-2. get
This command is used to retrieve a file.
It can be executed with "get file destination folder".
The delete option can also be used to delete remote files downloaded after transfer.
1-3. put
This command is used to store files.
The syntax is put source-file destination-folder, as shown in the example.
Like the get command, the delete option can also be used here to delete uploaded files from the local directory after transfer.
1-4. mkdir
Directory creation command.
It can be executed by "mkdir directory name".
1-5. call
This command executes shell commands on the remote side.
It can be executed with the "call command".
This command allows the shell of the remote server to be invoked, so that commands not provided by the WinSCP command can be implemented in the shell of the remote server.
2. Conclusion
These commands cover common scripted WinSCP transfers. The related examples show how they can be assembled into batch jobs; credentials and host-key fingerprints must be managed securely.
How to create an automatic file download and upload tool using the WinSCP command
Official references
■INFORMATION
■PROFILE
■CONTACT