Use batch files to upload and download files on the FTP server, batch ftp

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.