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

来源:PE吧  作者:小吧  发布于:2017-02-20 10:43:25 浏览:3057

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

 

  win7创建批处理文件方法:

 

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

新建文本文档

 

  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
 

复制到文本文档

 

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

修改为bat文件

 

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

管理员身份运行


上一篇:win7系统excel表格打不开怎么办
下一篇:删除u盘autorun.inf病毒防止数据被盗
相关推荐:
Win10右键没有添加到压缩文件|如何在右键里添加压缩
【实用小百科】主板电池没电可以这样判断
Win10提示自动修复无法修复你的电脑|自动修复不能开机
如何解决win7系统开机提示uxtheme.dll丢失?
抑制u盘病毒传播到电脑的方法
Win10怎么备份和还原系统注册表?
禁止修改删除win8桌面磁贴的操作步骤
如何取消勾选电脑自动重新启动?