如何创建批处理文件
的有关信息介绍如下:批处理文件是扩展名为.bat 或.cmd的文本文件,包含一条或多条命令,可以快速地进行批量处理。它使用方便、灵活,功能强大,自动化程度高。那么它是如何创建的呢?下面为大家简单介绍一个“清除系统垃圾文件”的批处理文件的创建。
PS:下图是批处理文件创建前后的图标变化。
在桌面鼠标依次右键——>新建——>文本文档;
在记事本中输入命令:
@echo offecho 正在清除系统垃圾文件,请稍等......del /f /s /q %systemdrive%\*.tmpdel /f /s /q %systemdrive%\*._mpdel /f /s /q %systemdrive%\*.logdel /f /s /q %systemdrive%\*.giddel /f /s /q %systemdrive%\*.chkdel /f /s /q %systemdrive%\*.olddel /f /s /q %systemdrive%\recycled\*.*del /f /s /q %windir%\*.bakdel /f /s /q %windir%\prefetch\*.*rd /s /q %windir%\temp & md %windir%\tempdel /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
依次点击文件——>另存为;
将文件扩展名改为.bat,然后点击确定保存即可。双击创建好的批处理文件即可清除系统垃圾!
保存时将文件扩展名改为.bat或者.cmd都可以。