批处理 经典案例代码

1. 找到速度最快的QQ服务器

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

2.删除QQ的广告

@echo off 
if exist C:\Progra~1\Tencent\AD\*.gif del C:\Progra~1\Tencent\AD\*.gif 
a.bat 

3. 是否中冰河

@echo off 
netstat -a -n > a.txt 
type a.txt | find "7626" && echo "Congratulations! You have infected GLACIER!" 
del a.txt 
pause & exit 

4. 自动清除系统垃圾

@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\*.* 

猜你喜欢

转载自www.cnblogs.com/justSmile2/p/10644799.html
今日推荐