DOS batch processing implements the "Automatic FTP batch file upload" Function

Source: Internet
Author: User

Reference:

The data files generated by the receiving and sending proxy format conversion tool are manually classified and uploaded to the path specified by each user on the server, you can also do this step by step manually. However, when there are many users (dozens or hundreds of users), the repetitive work workload is not small, and it is even more error-prone. I have noticed these problems very long ago. Maybe it is because I am lazy and I cannot bear mechanical repetitive work. Therefore, I wrote a script file very early to automate the above work. Now I will contribute to you, hoping to solve your troubles.

 

Script source code:(Here, "@ echo CD udtfile", where udtfile is the path for storing uploaded data. Because all users save the uploaded data to this directory in the environment they are using, the "hardcoded" method is used here. If you store data files in the same way as me, but the directory name is different, you just need to change udtfile to your directory name. If the path for each user to save data is different, this statement is not suitable for you, and the script needs to be further processed. Here we will not describe how to adjust it, I have the opportunity to contact us for further discussion. At the same time
11.227.35.40 "the FTP server accessed also has the aforementioned situation. Please modify the code according to the actual application .)

 

Rem Author: halftime <br/> REM Date: 2009.8.28 <br/> REM platform: applicable to Chinese windowsxp_sp3 <br/> @ CLS <br/> @ REM font green <br/> @ color e <br/> @ echo ******** * ********************** <br/> @ echo * FTP batch upload script * <br/> @ echo ** <br/> @ echo * function description: * <br/> @ echo * This script will generate the farmer's food * <br/> @ echo * direct data population file automatically uploaded by multiple organizations * <br/> @ echo * to the remote path of the specified FTP server. * <Br/> @ echo ** <br/> @ echo * prerequisites: * <br/> @ echo * 1、user.txt (organization information) the file must exist in * <br/> @ echo. * <Br/> @ echo * 2. The generated data file is in the same path as the script file * <br/> @ echo. * <Br/> @ echo ** <br/> @ echo * Note: * <br/> @ echo * a log file (* <br/> @ echo * okfiles.txt) is generated after the script is run ), it records the name of the successfully uploaded * <br/> @ echo * file. * <Br/> @ echo ********************************* <br/> @ pause </P> <p> @ echo off <br/> for/F "EOL =; tokens = 1, 2, 3 delims =, "% I in (user.txt) do (<br/> (@ echo open 11.227.35.40 <br/> @ echo % I <br/> @ echo. <br/> @ echo CD udtfile <br/> @ echo bin)> ftp.txt <br/> for/F % L in ('dir/B % K *. TXT ') Do (<br/> (@ echo put % L)> ftp.txt> okfiles.txt <br/>) <br/> @ echo quit> ftp.txt <br/> FTP-I-s: ftp.txt <br/>) <br/> @ pause

 

User.txt(User Info table:

 

 

Put the "script file", "user information", and data files to be uploaded in the same path:

 

 

 

Script File Download:

 

 

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.