I want to connect to the FTP server ftp://trmmopen.gsfc.nasa.gov/pub/merged/3B42RT from my command prompt in Windows 7.
It's always showing not connected.
I am running my PC behind proxy. I came to know about port error. Followed this solution here about port forwarding but still no result.
Windows built-in command-line ftp.exe
client does not support connecting over a proxy. It also supports an active mode only, what makes it difficult to connect though proxy anyway (even if some transparent proxy solution is used).
You have to use a 3rd party command-line FTP client that supports a passive mode and a proxy.
For example with WinSCP FTP client, you can use the following batch file (.bat
):
WinSCP.com /command ^
"open ftp://anonymous:[email protected]/ -rawsettings ProxyMethod=3 ProxyHost=proxy ProxyUsername=username ProxyPassword=password" ^
"cd /pub/merged/3B42RT" ^
"ls" ^
"exit"
See a guide to scripting with WinSCP and a guide for converting Windows FTP script to WinSCP script.
The above code is for an HTTP proxy. If you use a different proxy type, alter the ProxyMethod
setting accordingly. See https://winscp.net/eng/docs/rawsettings
Though easier is to configure the connection in WinSCP GUI and then have it generate a script template for you.
(I'm the author of WinSCP)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With