---
title: "命令行清理磁盘垃圾"
author: "henyue"
date: "2012-02-26T10:01:28Z"
tags: []
categories: ["非技术"]
slug: "untitled"
draft: false
lastmod: "2012-02-26T10:01:28Z"
id: 1423913
url: "https://henyue.iteye.com/blog/1423913"
---

```java

@echo off和谐版垃圾清理器
echo 自动清理tmp,_mp,gid,chk,bak等垃圾文件……
echo 正在清除系统垃圾文件，请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
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 Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统垃圾完成！
echo 按任意键退出垃圾清理器！
echo. & pause

```