Many people just have this wrong notion that windows command line FTP.exe can not be run in passive mode. It actually can be configured to run. The (undocumented or not well documented in ftp help) QUOTE command is the key here. QUOTE PASV command will set the FTP client to work in passive mode. Below is an example:
ftp>open
userid:
password:
ftp>quote pasv
ftp>binary
ftp>put
ftp>quit
To run a sequence of FTP command from a file you may use Batch command or VBScript. First create your ftp command file (say ftp.txt) in note pad. The content of the file would be as below. Replace the fields with in [] with appropriate values:
open [siteaddress.com]
[userid]
[password]
quote pasv
binary
put
quit
Simply write the following in a batch file (say ftp.bat) to execute the ftp.txtcontent:
c:\windows\system32\ftp.exe -s:c:\ftp.txt
If you want to use VBScript, create a VBScript file (say ftp.vbs) in notepad as well. The content of the script file would be as below:
Set objShell = CreateObject("WScript.Shell")
objShell.Run "c:\windows\system32\ftp.exe -s:c:\ftp.txt", , True
Set objShell = Nothing
Double click on ftp.vbs and voila!
請先 登入 以發表留言。