学习啦 > 学习电脑 > 操作系统 > 系统优化教程 > Win7系统创建批处理文件方法

Win7系统创建批处理文件方法

时间: 志艺942 分享

Win7系统创建批处理文件方法

  你还在为不知道Win7系统创建批处理文件方法而不知所措么?下面来是学习啦小编为大家收集的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 SettingsTemporary Internet Files*.*"

  del /f /s /q "%userprofile%Local SettingsTemp*.*"

  del /f /s /q "%userprofile%recent*.*"

  echo 清除系统LJ完成!

  echo. & pause

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

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

  方法二:

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

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

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

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


看了“Win7系统创建批处理文件方法”还想看:

1.Win7如何新建一键清理系统垃圾文件BAT脚本

2.批处理文件

3.win7系统怎么使用命令创建VHD虚拟硬盘

4.bat命令怎么批处理

5.Win7怎样快速创建程序桌面快捷方式

2783176