Win7系统怎样创建批处理文件?
发布时间: 2021-12-14 来源: 网络 编辑: word12345.com 阅读: 0 关键词: 系统教程

  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”才行)然后点击保存;



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



  方法二:

  1、打开“计算机”,点击“组织”—“文件夹和搜索选项”;



  2、在文件夹选项中点击“查看”选卡,在“高级设置”中确保“隐藏已知文件类的扩展名”未被勾选,点击应用并确定;



  3、参照方法一步骤1、2将命令输入到文本文档中,点击关闭按钮,在弹出的框中选择“保存”;



  4、将“新建文本文档.txt”单击右键,选择“重命名”,将后缀名“TXT”修改为“bat”按下回车键,在弹出的警告框中点击“是”即可。

热门教程

点击排行

最新教程