SoFunction
Updated on 2025-04-10

Another good batch bat learning tutorial page 2/5


Example 3: Use batch scripts to check whether it is in the Glacier. The script content is as follows:

Copy the codeThe code is as follows:

@echo off  
netstat -a -n >   
type  | find "7626" && echo "Congratulations! You have infected GLACIER!"  
del   
pause & exit  
The netstat command is used here to check the status of all network ports. You only need to know the ports used by common *s to easily determine whether they have been planted in the glacier. Of course this is not certain, because the default port of Glacier 7626 can be completely modified by people. What we introduce here is only the methods and ideas. What is introduced here is that if the methods and ideas are changed slightly, it will become a script that can check other *s. After adding parameters, ports and information list files, it will become a script that automatically detects all *s. Haha, isn't it very satisfying? The script also uses the combination command && and pipeline command|, which will be introduced in detail later.

Example 4: Automatically clear system garbage through batch processing, and the script is as follows:

Copy the codeThe code is as follows:

@echo off  
if exist c:windowstemp*.* del c:windowstemp*.*  
if exist c:windowsTempor~1*.* del c:windowsTempor~1*.*  
if exist c:windowsHistory*.* del c:windowsHistory*.*  
if exist c:windowsrecent*.* del c:windowsrecent*.*  
echo " Clean down! Press any key to exit"
pause & exit 

Save the above script contents and automatically delete the system garbage every time it is turned on. There are two points to note here: 1. DOS does not support long file names, so the Tempor~1 thing appears; 2. You can change it according to your actual situation to make it meet your requirements.
Previous page12345Next pageRead the full text