又一篇不錯的批處理bat學習教程第2/5頁
更新時間:2007年02月28日 00:00:00 作者:
例三,使用批處理腳本查是否中冰河。腳本內容如下:
復制代碼 代碼如下:
@echo off
netstat -a -n > a.txt
type a.txt | find "7626" && echo "Congratulations! You have infected GLACIER!"
del a.txt
pause & exit
例四,借批處理自動清除系統(tǒng)垃圾,腳本如下:
復制代碼 代碼如下:
@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 " 清理完畢!按任意鍵退出"
pause & exit
將以上腳本內容保存到autoexec.bat里,每次開機時就把系統(tǒng)垃圾給自動刪除了。這里需要注意兩點:一、DOS不支持長文件名,所以就出現(xiàn)了Tempor~1這個東東;二、可根據自己的實際情況進行改動,使其符合自己的要求。

