我正試圖通過FTP在批處理文件中下載文件。該解決方案與this previous question非常相似。唯一的區別是我收到「501服務器無法接受參數」錯誤。蝙蝠文件FTP命令
這裏是我的bat文件的代碼:
@echo off
echo user removed> ftpcmd.dat
echo removed>> ftpcmd.dat
echo CD /removed.com/assets/csv/>> ftpcmd.dat
echo LCD C:\Temp >> ftpcmd.dat
echo TYPE>> ftpcmd.dat
echo GET valid_file.php new.php>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat removed.com
del ftpcmd.dat
這裏是我的bat文件運行的輸出:
c:\Temp>test
Connected to removed.com.
220 Microsoft FTP Service
ftp> user removed
331 Password required for removed.
230 User logged in.
ftp> CD /removed.com/assets/csv/
250 CWD command successful.
ftp> LCD C:\Temp
Local directory now c:\Temp.
ftp> TYPE
Using ascii mode to transfer files.
ftp> GET valid_file.php new.php
501 Server cannot accept argument.
150 Opening ASCII mode data connection.
嘗試GET valid_file.php >> ftpcmd.dat – ApolloSoftware