I have a FTP server on a Windows Server 2012 machine and I am trying to get setup.exe
from it.
CMD.EXE log:
C:\\>ftp 1.2.3.4
Connect
It works in FileZilla, because FileZilla defaults to the passive FTP mode, which is more firewall/NAT friendly. The Windows FTP command-line client (ftp.exe
) not only defaults to the active mode, it does not even support the passive mode, on any version of Windows. It makes it pretty useless nowadays due to ubiquitous firewalls and NATs.
Read my article about the active and passive FTP connection modes to understand why the passive mode is a must.
Use any other Windows FTP command-line client instead. Most other support the passive mode.
For example WinSCP defaults to the passive mode and there's a guide available for converting Windows FTP script to WinSCP script.
Your can specifically use a batch file (.bat
) like:
winscp.com /command ^
"open ftp://my_username:password@1.2.3.4/" ^
"get setup.exe" ^
"exit"
(I'm the author of WinSCP)