最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Win10系统怎么编写批处理清除垃圾 编写批处理清除垃圾教程
时间:2018-12-04 编辑:袖梨 来源:一聚教程网
利用bat文件清除Win10系统使用久了产生的垃圾文件,不过应该怎么写呢?本篇文章小编给大家介绍一下,对此感兴趣的小伙伴们可以来看看。
编写步骤:
这里用到的就是bat批处理文件了,我们来举一个例子:
当然我们也可以自己手动添加一些文件路径,及自定义一些垃圾文件的格式,这里简单的介绍一下:
(1)%systemdrive%即C:根目录
(2)%windir% 即C:Windows文件夹
(3)%userprofile% 即用户文档文件夹
(4)del /f /s /q和rd /s /q都是删除命令
(5)*.*即所需删除文件,例如*.tmp就是所有.tmp格式文件,这种文件一般是临时文件了。
1、如下例打开记事本,在其中粘贴下列内容:(用户可以自定义修改)
@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 %systemdrive%recycled*.*
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 清除系统垃圾完成!
echo. & pause
2、存储为.bat文件。保存类型那里选择 所有文件哦。
3、然后双击执行这个文件,可以看到清除了不少文件。
相关文章
- win10 onedrive登录界面空白解决方法 10-12
- win10 vmware虚拟机蓝屏解决方法 10-12
- win10系统打开图片是黑色的 10-12
- win10自动扫描病毒设置教程 10-11
- win11电池养护模式怎么开启 05-11
- Win11机械硬盘磁盘碎片如何整理 Win11机械硬盘磁盘碎片整理方法 05-10