Scripting and Automation
Harry
· 13 Sep 2026
· 3 views
The Command Line
WinSCP automation runs from a command line with /command and session arguments, or from a script file:
winscp.com /command "open sftp://user@host/ -hostkey='ssh-ed25519 AAAA...'"
"put C:\deploy\app.war /opt/app/" "exit"Writing a Script File
open sftp://deploy@example.com/ -hostkey="*"
synchronize local C:www /var/www
exitThe synchronize and put commands mirror the GUI actions, so a repetitive deployment becomes a repeatable script.
Scheduling with Task Scheduler
Use Windows Task Scheduler to run winscp.com with the script file every night. This automates backups, log pulling and report distribution without any user.
Return Codes in Batch
winscp.com exits with code 0 on success and non-zero on failure, which lets deployment pipelines and scripts react to errors before continuing to the next step.
Key Points
- winscp.com runs scripts from the console.
- synchronize and put carry over GUI behavior.
- Task Scheduler turns scripts into scheduled jobs.
- Exit codes make automation pipelines reliable.