Command-line FTP, SFTP and FTPS client for Windows: ftpshellc
ftpshellc.exe is the console client installed with FTPShell Client. It gives batch files and schedulers what Windows' own ftp.exe cannot: SFTP and FTPS, resume, verified transfers, logs with rollover, meaningful exit codes and OpenPGP, while keeping the commands and the -s:file command files that ftp.exe users already have. It is included in the Enterprise edition and in the 30-day trial.
ftp.exe users feel at home
Start ftpshellc and you get an ftpshell> prompt with open, get, put, mget, mput, cd, dir, delete, rename, mkdir, quote and the rest. Type sftp, ftps, ftpsi or ftpsc to switch mode, or start with the /sftp or /ftps switches; give host:port on the command line to connect on startup; ! runs a Windows command without leaving the prompt. ftpsc is encrypted-login-with-clear-data for servers that require it.
Batch files move over unchanged
ftpshellc -s:file runs a plain command list exactly like ftp -s:file, so an existing batch job keeps its command file and gains encryption by switching to sftp or ftps mode. ftpshellc -script job.fscr runs a full FTPShell Script, listing parse errors before anything runs, for jobs that need loops, conditions, retry and onerror, sync and backup commands, timestamped file names, email reports and verification by CRC, MD5 or SHA-1.
Logs and exit codes a scheduler can act on
-logfile, -tslogfile or -log write a log, -append adds to it and -rollover keeps it from growing without bound; /nocolor keeps the output plain for capture. The exit code is 0 on success, 1 for license, file or parse errors, and otherwise the script's own exit code, so Task Scheduler, a monitoring agent or a wrapping batch file can tell a clean run from a failed one.
Encryption without extra software
-pgpkeygen generates RSA or DSA/ElGamal keys from 1024 to 8192 bits; keys can be listed, imported and exported; files can be encrypted (optionally signed), decrypted, signed, clear-signed and verified; -zip and -unzip handle archives; -protectstring produces a protected value that scripts store with setprotectedvar so no clear-text password sits in a script or batch file.
Licensing from the command line
-loadlic installs a license key file from the command line, for headless servers and machines managed by deployment tools. The same key covers the GUI and the console.
Running the GUI from the command line
The main program also takes command-line options: ftpshell.exe -script job.fscr runs a script minimized and exits when done; -logfile, -tslogfile and -append keep a rolling log; -set NAME=VALUE passes parameters that the script reads with getenvvar; exit code 1 signals a bad script or log path.
Questions people ask
Can ftpshellc replace the Windows ftp.exe command?
Yes. It understands the same interactive commands and the same -s:file command files, and adds SFTP, FTPS, resume, logs and exit codes.
Does the command-line client support SFTP?
Yes. Start it with /sftp or type sftp at the prompt. FTPS explicit and implicit are the ftps and ftpsi modes.
How do I run an FTP transfer from Windows Task Scheduler?
Create a task that runs ftpshellc -s:commands.txt or ftpshellc -script job.fscr with a log option, and have the task's failure condition look at the exit code. Because it is a console program it runs under any account the scheduler can use, logged on or not.
How do I keep the password out of the batch file?
Use ftpshellc -protectstring to produce a protected value, store it in the script with setprotectedvar, and use that variable as the login, password, key path or passphrase; it is decrypted only at connect time.
Which edition includes the console client?
Enterprise, and the 30-day trial. See the edition comparison.
Is there a GUI as well?
Yes. ftpshellc is installed alongside the graphical FTPShell Client; favorites, scripts and settings are shared, so a job can be built and tested in the GUI and then run from the console.
Is there a CLI FTP client for Windows, and how do I download or send a file from the command line, cmd, a batch file or a batch script?
Yes: ftpshellc.exe, the console client installed with FTPShell Client Enterprise. From cmd, type ftpshellc host, log in and use get to download or put to send a file. From a batch file or batch script, write the same commands to a text file and run ftpshellc -s:commands.txt, exactly as ftp -s:file works, then check %ERRORLEVEL% for the exit code.
How to connect from the terminal: terminal FTP connect, a terminal FTP client, open SFTP from the command line, and SFTP command line examples on Windows 10
ftpshellc host:port connects on startup; ftpshellc /sftp host opens an SFTP session from the command line and /ftps an FTPS one, or type sftp, ftps, ftpsi or ftpsc at the ftpshell> prompt to switch mode. A Windows 10 SFTP command-line example: ftpshellc /sftp sftp.example.com, then user name, cd /outgoing, mget *.csv, bye. It runs in the Windows Terminal, in cmd and in PowerShell alike.
Can I automate an FTP download script, a batch FTP upload script, or an SFTP batch example with the console?
Yes. For a fixed list of commands, a batch FTP upload script is a text file of put commands run with ftpshellc -s:file. For anything with conditions, an FTP download script in FTPShell Script uses ftpconnect or ftpconnectssh, ftpdownload with wildcards, retry and onerror, and runs with ftpshellc -script job.fscr. An SFTP batch example is the installed checkftp.fscr template switched to ftpconnectssh.
CLI FTP commands and SFTP commands: get, put, mget and mput from the prompt
At the ftpshell> prompt: open connects, user logs in, cd and lcd change the remote and local folders, dir lists, get and put move one file, mget and mput move every file matching a wildcard, delete, rename and mkdir manage the server, quote sends a raw command, ! runs a Windows command, bye quits. The same commands work in sftp and ftps modes, so an existing command file written for plain FTP needs no changes.
