知识屋:更实用的电脑技术知识网站
所在位置:首页 > 电脑技术

win7系统怎么创建批处理文件

发布时间:2017-03-31 15:04:40作者:知识屋

批处理文件也称为批处理脚本,顾名思义就是对某对象进行批量的处理。不过还有很多用户不懂怎么创建批处理文件,其实方法很简单,下面一起来看看win7创建批处理文件的方法。

win7创建批处理文件方法:

1、首先我们可以在任意位置新建一个文本文档,如下图所示:

win7系统怎么创建批处理文件

2、双击打开文本文档,将bat命令输入进去(这里以清理系统垃圾命令为例)

@echo off

echo 正在清除系统垃圾文件,请稍等......

del /f /s /q %systemdrive%\*.tmp

del /f /s /q %systemdrive%\*._mp

del /f /s /q %systemdrive%\*.log

del /f /s /q %systemdrive%\*.gid

del /f /s /q %systemdrive%\*.chk

del /f /s /q %systemdrive%\*.old

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 清除系统LJ完成!

echo. & pause

win7系统怎么创建批处理文件

3、点击左上角的“文件—另存为”,将保存类型修改为“所有文件”,将文件名修改为“xitonghe.bat”(这里重点就是后面的后缀,一定要是“.bat”才行)然后点击保存。

win7系统怎么创建批处理文件

4、在使用的时候最好在该批处理上单击右键,选择“以管理员身份运行”即可。

win7系统怎么创建批处理文件

以上就是win7创建批处理文件的详细方法,有需要创建批处理文件的朋友赶紧来试试吧。

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜