windows10系统不借助第三方软件,如何清理系统垃圾文件?
1、在桌面新建文本文档,将以下代码复制进去,点文件 - 另存为 - 文件名“清除系统垃圾.bat”,保存类型选择“所有文件”,编码选择“ANSI" - 保存。
@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 Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" del /f /s /q "%userprofile%\recent\*.*" echo 清除系统垃圾完成! echo. & pause
2、找到桌面上刚刚保存的“清除系统垃圾.bat”,右击以管理员身份运行,弹出“是否允许应用对你的设备进行更改”,选择“是”,程序运行完成即可。
以上方法不仅限于win10系统,其他windows系统如win11、win8、win7、windows XP等等也是可以的。