Another good batch processing bat learning tutorial page 1/5

Source: Internet
Author: User

Batch Processing, also known as batch processing scripts, takes the first three letters of the batch processing file suffix BAT.
It does not have a fixed format, as long as the following line is followed, it is OK: each line can be viewed as a command, each command can contain multiple sub-commands, starting from the first line of execution, until the last line ends, it runs on DOS. Batch Processing has a distinctive feature: convenient, flexible, powerful, and highly automated.
To learn batch processing well, the DOS basics must be solid! Of course, flexible mind is also an important aspect.
Example 1: first, give the most easy batch processing script to familiarize everyone with its face and save the following commands as name. bat and then execute (only the code is provided in the future, and the Save method is similar to the execution method ): Copy codeThe Code is as follows: @ echo off
Ping sz.tencent.com> a.txt
Ping sz1.tencent.com> a.txt
Ping sz2.tencent.com> a.txt
Ping sz3.tencent.com> a.txt
Ping sz4.tencent.com> a.txt
Ping sz5.tencent.com> a.txt
Ping sz6.tencent.com> a.txt
Ping sz7.tencent.com> a.txt
Echo press any key to exit...
Pause> nul

Can you understand it all? Is it easy? However, after performing this batch, you can create a file named a.txt on your own. The recorded information can help you quickly find the fastest QQ server and stay away from the painful process of transferring from the server. Here> means to put the things obtained by the preceding command in the following place,>, and> the volume file is getting bigger and bigger (think of how to destroy it ??). By the way, this batch processing can also be combined with other commands to achieve a completely automated judgment of the server speed. After the execution, the fastest Server IP address is directly displayed, isn't it great? It will be detailed later.

Example 2: an outdated example (a. bat) is provided ):

Copy codeThe Code is as follows: @ echo off
If exist C: Progra ~ 1TencentAD *. gif del C: Progra ~ 1TencentAD *. gif
Echo press any key to exit...
Pause> nul

Why is this an outdated example? It is very simple, because almost no one has used QQ with advertisements, so it is almost useless. However, once it was used, it could not be a small glimpse: deleting QQ ads and making the dialog box clean. The address used here is the default installation address of QQ. You can modify it as needed. The if command is used in this script to determine and delete ad images in a timely manner. You only need to disable the DOS window after the command is executed, without pressing CTRL + C to forcibly terminate the command, it keeps monitoring whether there are advertisement images (QQ also keeps checking whether its advertisement has been deleted ). Of course, this script occupies a little bit of memory.

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.