Batch Processing. To put it bluntly, it is a DOS operation. Some people think that DOS operations are outdated and backward, but they are not. Among them, the biggest advantage is fast, no trace. However, in many cases, Windows operations cannot solve the problem at all.
Common sense: Writing and modifying Batch Processing
Open notepad and write the content to be written in it. Save it as a bat file. You can also use NotePad to open the modification.
Batch Processing Application 1: scanning local ports
The master of this function is to scan which port is connected to the internet and which ip is connected. This is an irreplaceable benefit to promptly discover and intercept illegal connections.
However, it is too slow and annoying to start the optimization master, which is not conducive to random use. Therefore, it is especially important to compile such a batch to solve the problem.
**************************************** ********************
Code:
Netstat-n
Pause
Appendix: You can also add "@" at the beginning of each line so that the command will not be displayed.
**************************************** ********************
Batch Processing Application 2: common diseases and viruses
In fact, it is inevitable for Internet users to experience viruses. However, how can we find out if we are unfortunately infected? Do you really want to buy expensive anti-virus software? Not necessarily.
We can write batch processing to check some common network viruses. If you confirm that the virus is infected, you can download a dedicated antivirus tool to scan and kill the virus, or take other methods to kill the virus.
Next, I will take Happy time as an example to analyze:
Main file: 1.bat
Other files: 2.bat 3.bat
**************************************** ********************
1. bat code:
@ If exist c: folder. htt call 2.bat
@ If exist d: folder. htt call 2.bat
@ If exist e: folder. htt call 2.bat
@ If exist f: folder. htt call 2.bat
**************************************** ********************
2. bat code:
@ Echo found Happy Time virus!
@ Call 3.bat
@ Pause
**************************************** ********************
3. bat code:
@ C:
@ Dir *. htt *. ini/s/a> 1.txt
@ D:
@ Dir *. htt *. ini/s/a> 1.txt
@ E:
@ Dir *. htt *. ini/s/a> 1.txt
**************************************** ********************
In this way, there will inevitably be a large number of folder. htt and Desktop. ini, so that you can roughly check whether the computer is infected with viruses.
Batch Processing Application 3: File Processing
Suppose that I want to move and delete files on a large scale. If I operate on Windows, errors will inevitably occur, and these errors are hard to detect. Therefore, batch processing is not only simple, but also easy to identify and correct errors in a timely manner.
For example, I want to move the htm file of drive d to drive E, format drive D, move the file back to drive D, and change the suffix to html.
**************************************** ********************
1. bat code:
@ E:
@ Md d
@ D:
@ Copy *. htm e: d
@ If exist e: d *. htm call 2.bat
**************************************** ********************
2. bat code:
@ Format d:/q
@ Copy e: d *. htm d:
@ D:
@ Ren *. htm *. html
**************************************** ********************
From the example, we can see that if a problem occurs, it is easy to be discovered. This proves the availability of batch processing.
The Application of batch processing is profound and unpredictable. We hope you can use the DOS command to optimize it so that it can better serve us.