Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is batch processing?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what is batch processing". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is batch processing".

OK,never claver and get to business (get to the point with less gossip). Batch processing, also known as batch script, is translated into BATCH, and the batch file suffix BAT takes the first three letters. Its composition has no fixed format, as long as it follows the following ok: each line can be regarded as a command, each command can contain multiple sub-commands, from the first line to the end of the last line, it runs on the platform of DOS. Batch processing has a very distinct feature: easy to use, flexible, powerful function, high degree of automation. I don't want my tutorials to be boring because they involve code (batch processing is code, right? The problem is inherently boring, and few people can calm down in the face of a screen full of code. So I will use many simple and practical examples to let friends reading this tutorial to experience the charm of batch processing, feel its strange character, unwittingly fall in love with batch processing (halo, how is love? What exactly does batch processing have to do with love? Answer: no! ). Another word of gossip: to learn batch processing well, the foundation of DOS must be solid! Of course, a flexible brain is also a very important aspect.

Example 1. First give you the most easy batch script to get acquainted with it, save the following lines of commands as name.bat and then execute them (only the code is given later, which is similar to the way it is executed):

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

Exit

Can you read it all? Is it very easy? But its role is very practical, after the execution of this batch, you can create a file called a.txt on your current disk, which records information that can help you quickly find the fastest QQ server, away from the painful process of "transferring from the server". The function of > > is the same as that of > >, but the difference is that the result is appended to the result of the previous line, specifically the next line, while the result of the previous command will be retained, which can make the a.txt file bigger and bigger. ). By the way, this batch can also be combined with other commands to make it completely automatic to judge the speed of the server, and directly display the fastest server IP after execution, isn't it cool? It will be described in more detail later.

Example 2. Give another example that is out of date (a.bat):

@ echo off

If exist C:\ Progra~1\ Tencent\ AD\ * .gif del C:\ Progra~1\ Tencent\ AD\ * .gif

A.bat

Why is this an outdated example? It's simple, because now almost no one uses QQ with ads (KAO, my QQ even shows my friend BWH! ), so it is almost useless. But once upon a time, its role was impossible to see: delete QQ ads and keep the dialog box clean. The address used here is the default installation address of QQ, and the default batch file name is a.bat, which you can modify according to the situation. In this script using the if command, so that it can timely judge and delete the effect of advertising pictures, as long as you do not close the command after the execution of the DOS window, do not press CTRL+C to force the termination of the command, it has been monitoring whether there are advertising images (QQ also keeps checking whether their ads have been deleted). Of course, this script takes up a little bit of your memory, hehe.

For example 3, use a batch script to check if a glacier is hit. The script reads as follows:

@ echo off

Netstat-a-n > a.txt

Type a.txt | find "7626" & & echo "Congratulations! You have infected GLACIER!"

Del a.txt

Pause & exit

Here the netstat command is used to check the status of all network ports. As long as you know the ports used by common Trojans, you can tell whether they have been planted by people or not by easy. However, this is not certain, because the glacier default port 7626, can be completely modified. What is introduced here are only methods and ideas. Here is the method and ideas to make a little change, you can check other Trojans script, and then change, add parameters and ports and information list files, it will become a script to automatically detect all Trojans. Ha ha, is it very enjoyable? The script also takes advantage of the combined command & & and pipe command |, which will be described in more detail later.

For example 4, the system garbage is automatically removed by batch processing, and the script is as follows:

@ echo off

If exist c:\ windows\ temp\ *. * del c:\ windows\ temp\ *. *

If exist c:\ windows\ Tempor~1\ *. * del c:\ windows\ Tempor~1\ *. *

If exist c:\ windows\ History\ *. * del c:\ windows\ History\ *. *

If exist c:\ windows\ recent\ *. * del c:\ windows\ recent\ *. *

Save the contents of the above script to autoexec.bat, and automatically delete the system garbage every time you boot. Here need to pay attention to two points: first, DOS does not support long file names, so there is a Tempor~1 this thing; second, according to their own actual situation to change to make it in line with their own requirements.

Well, seeing here, are you already a little interested in batch scripts? Do you find yourself falling in love with this thing? Don't be happy too early, love is not a simple thing, it may bring you happiness and happiness, of course, it can also make you want to jump. If you dare to continue if you know it's hard, I took YOU! Continue to work hard, maybe you may not get true love in the end (it is really possible, everyone who has loved knows), but you can experience the whole process of love, that's all. Sour, bitter and spicy, there is no sweet God knows.

Why would batch processing have something to do with love? It's not that I'm bored, nor because it's so interesting, for two reasons: first, batch processing has a lot in common with love, and in some places I can't explain it in "professional" jargon (I don't doubt my ability to express. But the thing itself is difficult to explain), said = did not say, but use the love analogy that everyone knows (what is love? I * * how do I know! Maybe your heart will brighten up and get twice the result with half the effort, so why not do it? Second, I am not in a very good state during this period of time. I have a cold, fever and a stuffy nose, but it is mainly emotional and mental destruction, and the person who is engaged in it is bored. By writing a few words of emotion when writing a tutorial, we can all buy dog skin ointment. It can be omitted (maybe it has some effect-so as not to let you fall asleep after watching, kowtow your head and come to me to reimburse you for medical expenses. Maybe you will see Yang Guo, Zhang Wuji and other heroes written by Jin veterans in the next tutorial.

Friends who have read the first chapter must have a preliminary impression of batch processing and know what it is used for. But do you know what the essence of batch processing is? In fact, it is very simple: be flexible! There is nothing impossible, only the unexpected. This is a little different from love, because the world of love is the world of two people, wishful thinking is not called love (add: it's called unrequited love. Nonsense! On the other hand, batch processing is a person's paradise, you can do whatever you want, there is no realm that cannot be reached!

Batch processing looks disorganized, but its logic is not lower than other programming languages (such as assembly), if you write a script is a mess, although every line of commands are correct, but from beginning to end, you may not get the results you want, maybe a screen of Bad command or fail name. This has something in common with love: operating step by step, missing or increasing the number of steps can lead to unwanted results. Friends who fall in love, I believe there is no doubt about this sentence. My love batch, the output is not Bad command or fail name, the screen is like this: 'your love' is not an internal or external command, nor is it a runnable program or batch file. Then the cursor keeps flashing, waiting for the next wrong input.

Starting from this chapter, we will introduce the commands commonly used in batch processing from shallow to deep. Many common DOS commands are widely used in batch scripts. They are the BODY part of batch scripts, but batch processing is more flexible and automated than DOS. To learn batch processing well, DOS must have a solid foundation. Here we only talk about some DOS commands that are rarely used (relatively speaking), but not common commands such as COPY, DIR, etc. (these seemingly simple commands are actually very complicated, and I'm afraid I can't even explain them! ).

Example five, let's look at an example first. This is a very interesting script, a small and practical good thing, the batch processing "automation" features incisively and vividly. First introduce the origin of this script: we all know the assembler (MASM) on the machine process, first to assemble the source code, link, and then execute, and there are a lot of links need to enter a lot of things, very troublesome (only experienced friends understand). How to make this process simple? When we were working on the assembly course design, I was "forced" to write this script, which is very cool to use, hehe. Look at the contents of the script:

@ echo off

:: close echo

Cls

:: clean screen

Echo This programme is to make the MASM programme automate

:: display info

Echo Edit by CODERED

:: display info

Echo Mailto me: qqkiller***@sina.com

:: display info

If "% 1" = "" goto usage

:: if input without paramater goto usage

If "% 1" = = "/?" Goto usage

:: if paramater is "/?" Goto usage

If "% 1" = = "help" goto usage

: if paramater is "help" goto usage

Pause

:: pause to see usage

Masm 1.asm

:: assemble the .asm code

If errorlevel 1 pause & edit 1.asm

:: if error pause to see error msg and edit the code

Link 1.obj & 1

:: else link the .obj file and execute the .exe file

: usage

:: set usage

Echo Usage: This BAT file name [asm file name]

Echo Default BAT file name is START.BAT

:: display usage

Don't be frightened by this pile of things, calm down and read it carefully (think back to how the first paragraph in the first chapter is written! ). The explanation of each line of command has been given, and the two colons are followed by the E text that explains the content of the previous line. (friends who are afraid of E text do not have to worry, they are all very easy. They are easy to understand. They really don't know how to look up a dictionary. Which is not displayed and has no effect when the script is executed There is a colon at the beginning of the penultimate line, which is not a clerical error. The specific role will be discussed in more detail later. Masm and link in this script are assemblers and linkers, which must be associated with the edit program and the source code you want to edit (and, of course, this script, nonsense! Together in the current directory Using this batch script, manual input can be reduced as much as possible. in the whole process, you only need to press the enter key to realize the automatic conversion from the assembly source code to the executable exe file, and has the function of intelligent judgment: if there is an error in the source code during assembly (the assembly is unsuccessful), the display of the error message is automatically paused, and the editing source code interface is automatically entered after pressing any key. If the source code is successfully assembled, the connection is made, and the generated exe file is automatically executed after the connection. In addition, because of the simplicity and flexibility of batch commands, this script also has a good improvement, simple modifications can be in line with the computer habits of different friends. Friends who are learning to compile, don't forget to do an internship!

The following commands appear in this script: @, echo,:, pause,: and goto,%, and if. And this chapter will talk about these commands.

1. @

This symbol is not unfamiliar to everyone, the essential symbol of email, how did it end up in batch processing? Ha ha, it is not its fault, batch processing is inseparable from it, otherwise it is not perfect. Its function is to make the command itself of the line behind it not appear in the execution window (what a roundabout sentence! ). Ha ha, to put it more popularly, if there is it at the beginning of the line, the command of this line will not be displayed. In example 5, in the @ echo off in the first line, the purpose of @ is to make the script execute without displaying the following echo off. Now do you understand? Still don't understand? It doesn't matter. After reading the brief introduction to the echo command, you will understand it.

2 、 echo

It means "feedback" and "echo" in Chinese. It is actually a switch command, which means that it has only two states: on and off. So there are echo on and echo off commands. Executing the echo command directly displays the current echo command status (off or on) execution echo off turns off echo, and all commands that follow it do not display the command itself, only the results of execution, unless the echo on command is executed. In example 5, the @ command on the first line and the echo off command combine to achieve two purposes: do not display the echo off command itself, and do not display the commands themselves in subsequent lines. It's a bit of a mess, but if you practice, you'll get a refund in 3 minutes.

Another use of the echo command: you can use it to display information! For example, on the penultimate line in example 5, Default BAT file name is START.BAT will be displayed in the window after the script is executed, while the echo command itself will not be displayed (why? ).

Another use of the echo command: you can edit the text file directly. Example 6:

Echo nbtstat-A 192.168.0.1 > a.bat

Echo nbtstat-A 192.168.0.2 > > a.bat

Echo nbtstat-A 192.168.0.3 > > a.bat

The method of editing the contents of the above script is to enter directly on the command line and enter each line. Finally, an a.bat file will be generated in the current directory, and the result will be obtained by direct execution.

3 、::

The purpose of this command is simple: it is a comment command, which is equivalent to the rem command in a batch script. The content behind it is not displayed and has no effect at execution time, because it is just a comment, which only increases the readability of the script and / * in the C language. * / similar. Everyone on earth can understand it, so there is no more to say.

4 、 pause

The Chinese word for "pause" (see your workman), I always thought it was the simplest command in batch processing, simple and practical. Its function is to pause the current program process and display a message: please press any key to continue. . . . In example 5, this command is used twice, the first is to let the user see the program information clearly, and the second is to display the error assembly code information (actually, not because it wants to display the error message, but the masm program was temporarily stopped when displaying the error message, so that you can see where your source code is wrong).

5.: and goto

Why introduce these two commands together? Because they are inseparable, no matter which one is less or more, it will make mistakes. Goto is a jump command,: is a tag. When the program runs to goto, it automatically jumps to the defined part to execute (is it inseparable? ). In example 5, a: appears at the beginning of the penultimate line of line 5, then the program automatically jumps to the part of the tag definition when it runs to goto, and the result is the script usage (usage is the tag name). It is not difficult to see that the goto command is based on this colon and tag name to find where it should jump, which is an one-to-one correspondence. The goto command is also often used in conjunction with the if command. As for the specific usage of these two commands, refer to example 5.

Another use of the goto command is to end the program early. Use the goto command to jump to a tag in the middle of the program, and the content of that tag is defined as exit. Such as:

……

Goto end

……

: end

Here: end is on the last line of the script! In fact, this example is very retarded. You will know about the if command and the combination command later.

6.%

This percent sign is not strictly a command, it is just a parameter in a batch (except if multiple% are used together, which will be described in more detail later). But don't think it's just a parameter to underestimate it (see how much of it is used in example 5? Without its batch processing capability, it is reduced by 51%. Take a look at example 7:

Net use\% 1\ ipc$% 3 / u: "% 2"

Copy 11.BAT\% 1\ admin$\ system32 / y

Copy 13.BAT\% 1\ admin$\ system32 / y

Copy ipc2.BAT\% 1\ admin$\ system32 / y

Copy NWZI.EXE\% 1\ admin$\ system32 / y

Attrib\% 1\ admin$\ system32\ 10.bat-r-h-s

The above code is part of the Bat.Worm.Muma virus, and the username,3% represented by IP,2% for 1 represents password. The execution form is: script file name parameter one parameter two.... no, no, no. Assuming that the script is saved as a.bat, it will be executed as follows: an IP username password. Here IP, username, and password are three parameters, all of which are indispensable (because the program does not run correctly, not because the syntax of the parameters is not correct) so that during the execution of the script, the script will automatically use your three parameters in turn (remember, in turn! It is also an one-to-one correspondence. ) instead of 1%, 2% and 3%, so as to achieve the purpose of flexible use (just imagine, if IP, username and password are all defined directly in the script, then the role of the script will be fixed, but if you use%, different parameters can achieve different purposes, isn't it more flexible? ).

The use of this parameter will be described in subsequent chapters. Must be very skilled, this requires a lot of practice, need to make some hard work!

That's all for this chapter. Maybe a friend asked: why didn't you introduce the if command? Oh, it's not that I forgot, but it's not easy to make it clear. Let's talk about it in the next chapter! If you are a beginner, you may be able to digest the things mentioned in this chapter. Remember that DOS is a batch BODY, and any DOS command can be used in a batch script to perform specific functions. Have you thought of using what's in your stomach to write something with automation color? It's very simple, it's just a collection of DOS commands, and I'm sure you, who call yourself a genius, will automate the DOS part of the computer exam with batch processing.

Annoying! Just like a half-old woman to menopause, everything wants to nag a few words, everything feels uncomfortable, depends on who is unhappy. Knowing that there was a tiger in the mountain, he went to Tiger Mountain, and finally left a scar and returned in vain, only to find that he was so fragile, so small, so vulnerable. Hovering on the brink of collapse, I suddenly recall the moment when I was flat for the last time, and I really miss it (in fact, I don't like being flat, let alone being beaten). I need to vent, I hit the keyboard desperately with my fingers, and these words appear on the screen in a rhythmic sound. But is this another way to vent? The Chinese are still strong. As early as thousands of years ago, Confucius said, "it is difficult to support only women and villains." he really has foresight and admiration! Although it is venting, please rest assured that with my temper, since I have decided to write this tutorial, I will try my best to write it well and write it perfectly, leaving absolutely no regret for myself, or I didn't write this tutorial!

Once a classic batch tutorial appeared on your screen, you didn't save it, and you didn't regret it until you couldn't find its link. This is the greatest pain in the world. If God can give you a chance to read it again, you will say three words to that tutorial: I love you! If you have to add a time limit to this love, you hope it will be 100 years. Because 100 years later, I'm afraid you'll be dead already! Now, this batch tutorial you are reading appears on your screen, although it is not as good as the classic one you once read, but if you barely pass it. Will you love it? Will it be as long as 50 years? The answer is: try it.

Some of the most important commands in the batch script will be described in detail in this chapter, but unfortunately, I haven't mastered some of the details so far. Just like I don't know much about love. But I've been working hard, even if I haven't got anything. So what I may say will be more general, but I will tell you the method. What is left is a matter of time and needs to be honed by myself. Let's work together. Three feet of ice was not built in a day, and dripping water is not built in a day. Some things, such as learning batch processing, such as loving a person, cannot be achieved quickly, and there are even cases where you work hard and gain very little. Once again, when reading this tutorial, be sure to calm down, unless you have mastered everything in this tutorial-but you don't have to read it, it's a waste of time!

7 、 if

Follow on to the previous chapter and then move on to the if command. In general, the if command is a command that represents judgment, and according to each result, it can correspond to a corresponding operation. Let's talk about its three uses separately here.

(1) input judgment. Let's go back to the sentences in case 5:

If "% 1" = "" goto usage

If "% 1" = = "/?" Goto usage

If "% 1" = = "help" goto usage

The input parameter is judged here. If the parameter is empty (no parameter), then jump to usage; if the parameter is /? Or help (we usually look at the help of a command, is it entered /? Or help, this is done here just to make the script look more like a real program), also jump to usage. Here you can also use a negative form to express "not equal", for example: if not "% 1" = "" goto usage, it means that if the input parameter is not empty, then jump to usage (in practice, this is meaningless, here is introduced usage, do not care so much, hehe. (isn't it easy? In fact, translating it into Chinese and experiencing it will be understand.

(2) existential judgment. Let's take a look at the sentence in example 2:

If exist C:\ Progra~1\ Tencent\ AD\ * .gif del C:\ Progra~1\ Tencent\ AD\ * .gif

If those gif files exist, delete them. Of course, there is also example 4, which is all the same. Note that the conditional judgment here exists, or it can be judged that it does not exist, such as the following sentence, "exit the script if those gif files do not exist": if not exist C:\ Progra~1\ Tencent\ AD\ * .gif exit. It's just an extra not to say no.

(3) result judgment. Or take the example five surgery (did not expect their own script, unexpectedly so useful, hehe):

Masm 1.asm

If errorlevel 1 pause & edit 1.asm

Link 1.obj

Assemble the source code first, pause the error message if it fails, and enter the editing interface automatically after pressing any key; otherwise, connect the generated obj file with the link program. This is only about the if command, which I'll talk about later. This usage is to first judge the error code after the execution of the previous command (also known as the error code, the DOS program has a return code after running), and if it matches the defined error code (the error code defined here is 1), then the corresponding operation is performed (here the corresponding operation is the pause & edit% 1.asm part).

In addition, like the other two usages, this usage can also express negation. The meaning of the above three sentences is still expressed in negative form, and the code becomes:

Masm 1.asm

If not errorlevel 1 link 1.obj

Pause & edit 1.asm

See the essence? In fact, it's just an exchange of commands executed after judging the result. The effects of "if not errorlevel 1" and "if errorlevel 0" are equivalent, indicating that the last masm command was executed successfully (because it is an erroneous judgment, and the return code of 0mem0 means negative, that is, the error does not exist, that is, the masm execution is successful). Whether to add not here and whether the error code is 0 or 1 are two questions worth considering. Once the script is not successfully matched, it will definitely go wrong, so you must have a deep understanding of it. How to understand deeply? Practice! Write a script by yourself, and then write in the case of not and without not, and the return code is 0 or 1, respectively. Is it troublesome for you to calculate the situation in only four? There are more troubles when we introduce pipe commands and combination commands later! Scared? He he. So that the difference between the two situations can be clearly seen from the results of the implementation.

This use of errorlevel results is the most difficult use of the if command, but it is also the most useful. If you don't know how to use errorlevel to judge the return code, it is troublesome to use else to represent the "otherwise" operation to achieve the same effect. The above code must become:

Masm 1.asm

If exist 1.obj link 1.obj

Else pause & edit 1.asm

About the three uses of the if command say here, the understanding is very simple, but the application is not necessarily so easy to use, mainly a matter of proficiency. Some friends may be a little surprised, why I did not give a usage introduction similar to the following three lines, because the following three lines are the explanation of its own usage in the help of the if command, anyone only needs a "if /?" You can see that I don't need to waste more breath here; more importantly, I think the introduction is not clear, and the viewer may not necessarily understand it, so I use my own understanding of the if command above to introduce it. It is important to note that the formats of these three usages are different and cannot be changed, but they are actually interchangeable (thinking that in essence, these three usages are all based on judgment. Philosophy teaches us to see the nature of things through phenomena! ). Interested friends can do some research on their own.

IF [NOT] ERRORLEVEL number do command

IF [NOT] string1==string2 do command

IF [NOT] EXIST filename do command

8 、 call

Friends who have studied assembly or C must know what the call instruction means, and it actually means the same here. In a batch script, the call command is used to invoke one batch script from another. Look at example 8 (the default three script file names are start.bat, 10.bat, and ipc.bat, respectively):

Start.bat:

……

CALL 10.BAT 0

……

10.bat:

……

ECHO IPA%.%1 > HFIND.TMP

……

CALL ipc.bat IPCFind.txt

Ipc.bat:

For / f "tokens=1,2,3 delims=" I in (1) do call heiit.bat I j k

Do you see anything wrong? Don't you see? It's right if you don't see it. In fact, there's nothing wrong. How can you see that? From the above two scripts, you can get the following information: 1. Script calls can be used flexibly, recycled and repeated. 2. Script calls can use parameters! I won't say much about the first point. If you are smart, you should know it as soon as you see it. Here is the second point.

In start.bat, 10.bat is followed by the parameter 0, and the effect of execution is to replace the parameter% 1 in 10.bat with 0. In start.bat, ipc.bat is followed by the parameter ipcfind.txt (a file, which can also be used as a parameter). The effect of execution is to replace% I,% j and% k in ipc.bat with three variables on each line in ipc.bat (it doesn't matter here, you'll understand after learning the for command). The parameter call here is very flexible and needs to be experienced when using it. During the begining period, you can first learn to only call the script. As for the case of using the parameters of the script together, you will naturally have a deeper understanding in the later study, because after you have been able to flexibly use the batch script, how to make the code write more concise, more perfect and more efficient is naturally included in the scope of consideration. At this time, you will find that you will directly add parameters when calling the script. Can double the efficiency of the code. By the way, the above scripts, are all part of the Bat.Worm.Muma virus, and in later tutorials, you will have the opportunity to see the true face of the virus.

Does that mean that there are at least two batch script files in the same directory (only one who do you call? )? Oh, pay attention, this sentence is wrong! Only one can still call-call itself! Example 9 (default script file name a.bat):

Net send% 1 This is a call example.

Call a.bat

When these two sentences are combined, the effect is naturally not good, because there is only one machine to send messages, who is afraid of who? I'll give you a gift in return! But if there are 100 machines running at the same time, and each machine opens 10 and the window sends a message to a target machine at the same time, hehe. Here, the function of call a.bat is to call itself, and then call itself after executing the previous net send command, which achieves the purpose of circular execution.

Give a very interesting script, interested friends can experiment. Example 10 (default script file name is a.bat):

Call a.bat

Be sure to execute it under the DOS window, otherwise you will only see a window flash by and you will not see the final result. After execution, when the script is executed 1260 times, don't forget to think about why! Love is sometimes like this script, once it falls into an endless cycle, the final result is unexpected. Just love, absolutely will not wait to be cycled so many times for no reason, perhaps in the third time there is a hint of love is aborted.

9 、 find

This is a search command that is used to search for specific strings in a file and is usually used as a matting program for conditional judgment (why do I suddenly think of these four words? ). The use of this command alone is rare in batches because it doesn't make any practical sense. Let's use example 3 to illustrate:

@ echo off

Netstat-a-n > a.txt

Type a.txt | find "7626" & & echo "Congratulations! You have infected GLACIER!"

Del a.txt

Pause & exit

First use the netstat command to check if there is any glacier default port 7626 active, and save the results to a.txt. Then use the type command to list the contents of the a.txt, and then search for the string "7626" in the list. If you find anything, you will be prompted to hit the glacier, otherwise you will exit. Look, the find command is actually that simple, but there is one thing to note: if you do not use the type command to list the contents of a.txt, but directly use the find command to find "7626" (find a.txt "7626" & & echo "Congratulations! You have infected GLACIER!") in a.txt, you must give the absolute path to this a.txt (I have tried, find does not have the function that the default path is the current path) and must be specified manually. Maybe I'm wrong. Welcome to correct me. Because there is a sentence in the help of the find command: if no path is specified, find will search for text typed or generated by another command. The "other command" here naturally refers to the type command.

As for the other parameters of the find command, such as v, n, I, etc., interested friends to study it themselves, this already belongs to the content of DOS learning, we will not introduce it here. Some of the more subtle uses of the find command and other commands (some of which are simply amazing) will be covered in subsequent tutorials and hope to follow.

10 、 for 、 set 、 shift

Why put these three orders together? Apart from my explanation, I am afraid no one can think of the reason! A very simple sentence: in fact, I do not quite understand! Yes, for these two orders, I began to learn from the study of Bat.Worm.Muma virus. A lot of time has passed, but I still don't fully understand it. I'm afraid I won't even understand it myself, and I'm even more afraid of accidentally making a mistake and becoming a sinner. So I'll give you a script to tell you how to make a preliminary impression of these two commands, which is actually an introduction to these two commands, not how to understand them. Because it's not easy to understand such two delicate commands (especially for)! Maybe you will praise me and say that I am honest, but if I don't understand, I don't understand; maybe you will scold me and tell me to get out of here since I don't understand, and don't be embarrassed here; maybe you will say something that sounds good or bad. It's up to you. Even if I don't agree with what you say, I will defend to the death your right to say it. See example 11:

@ echo off

For /? > for.txt

Set /? > set.txt

Shift /? > shift.txt

Exit

Thank you for your reading, the above is the content of "what is batch processing", after the study of this article, I believe you have a deeper understanding of what batch processing is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report