Use batch files to upload and download files on the FTP server, batch ftp
1. From the file in the root directory of the ftp server to the specified folder
Format: ftp-s: [configuration file] [ftp address]
For example, ftp-s: c: \ vc \ ftpconfig.txt 192.168.1.1
Create a batch file: Name it test. bat (you can name it casually. For ease of operation, name it 1.bat)) and copy the above content.
The content of the ftpconfig.txt file is:
Testuser
Test
Get test.exe C: \ ftptest \ testdownload.exe
Bye
Explanation:
The first two commands are fixed, including the user name and password.
Get test.exe C: \ ftptest \ testdownload.exe downloads the test.exe file under the ftpserver root directory to the local C: \ ftptest \ directory named testdownload.exe
Quit exit
After you execute the created batch file, you can see that the file is automatically downloaded to the file you specified.
2. Add the specified file on the ftp server and download the file to the specified folder.
Format: ftp-s: [configuration file] [ftp address]
For example, ftp-s: c: \ vc \ ftpconfig.txt 192.168.1.1
Create a batch file: Name it test. bat and copy the above content.
The content of the ftpconfig.txt file is:
Testuser
Test
Cd test
Get test.exe C: \ ftptest \ testdownload.exe
Bye
Explanation:
The first two commands are fixed, including the user name and password.
Cd Open folder
Get test.exe C: \ ftptest \ testdownload.exe downloads the test.exe file under the ftpserver folder to the local C: \ ftptest \ directory named testdownload.exe
Quit exit
3. Upload the file to the root directory of the FTP server.
Format: ftp-s: [configuration file] [ftp address]
For example, ftp-s: c: \ vc \ ftpconfig.txt 192.168.1.1
Create a batch file: Name it test. bat and copy the above content.
The content of the ftpconfig.txt file is:
Testuser
Test
Put C: \ ftptest \ testdownload.exe test.exe
Bye
Explanation:
The first two commands are fixed, including the user name and password.
Cd Open folder
Put C: \ ftptest \ testdownload.exe test.exe upload the local C: \ ftptest \ testdownload.exefile to the ftpserver named test.exe
Quit exit
4. Upload the file to the directory specified by the FTP server root
Format: ftp-s: [configuration file] [ftp address]
For example, ftp-s: c: \ vc \ ftpconfig.txt 192.168.1.1
Create a batch file: Name it test. bat and copy the above content.
The content of the ftpconfig.txt file is:
Testuser
Test
Cd test
Put C: \ ftptest \ testdownload.exe test.exe
Bye
Explanation:
The first two commands are fixed, including the user name and password.
Cd Open folder
Put C: \ ftptest \ testdownload.exe test.exe upload the local C: \ ftptest \ testdownload.exefile to the testfile folder on the ftpserver with the name test.exe
Quit exit