五个方面16个问题:如何用批处理修改文本文件?

来源:百度文库 编辑:查人人中国名人网 时间:2024/03/29 03:57:26
RT

要一个实例,谢谢!

很简单,批处理文件都是以.bat为后缀的,是一个可执行文件.如果双击的话就会执行!
但是你可以将该批处理文件的后缀该为.txt以文本文件的形式打开,之后修改!
譬如: 一个文件名为 "快速清除系统垃圾.bat"的批处理文件 将.bat 修改为
.txt 也就是 "快速清除系统垃圾.txt"
双击就可以打开
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统垃圾完成!
echo. & pause
修改好之后保存, 在将 .txt 改为 .bat
over
呵呵!