用批处理文件清理垃圾文件时候出现的问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 07:41:22
我用批处理文件(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 %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\\Tempo

把代码贴出来看看,是哪里问题

制作此批处理的人考虑到了太多的垃圾文件,他想要删除的东西在你的电脑里面并不存在,他只删除的你的电脑存在的东西,所以放心吧,没事的。

你使用的是别人现成的 他可能在批处理里面写了 G H E这些盘符,而你没有这些分区 就会显示不正确的提示 不影响的

用个毛批处理 没鸟效果

去用优化大师和360清理
干干净净

给你一个我写的

@echo on
title Miharu垃圾删除脚本
cls
if not exist %temp% md %temp%
@echo ******************新建需要删除的目录文件******************
dir /b /a %windir%\$*$ >%temp%\miharudel.miharu

@echo ******************修改WINDOWS升级之后留下的反安装目录属性******************

FOR /F "eol=; tokens=1,2* delims=, " %%m in (%temp%\miharudel.miharu) do attrib %windir%\%%m -r -s -h

@echo ******************对目录进行删除******************
FOR /F "eol=; tokens=1,2* delims=, " %%m in (%temp%\miharudel.miharu) do rd %windir%\%%m /s /q

@echo ******************删除Windows目录下的临时文件******************
del %windir%\*.log
del %windir%\*.bmp
del %windir%\*.tmp
del %windir%\*.