我有一个替换DELTree命令的问题我写了一个像12年前的小批处理文件或用于Windows XP和ME的东西我想在Windows 10上使用它来清除TEMP文件和PREFETCH和其他我会很感激如果你告诉我命令的替换是什么
@ECHO OFF
deltree /y %systemroot%\temp\*.*
deltree /y %systemroot%\system\*.tmp
deltree /y %systemdrive%\*.tmp
deltree /y %systemroot%\*.tmp
deltree /y %systemroot%\Prefetch\*.*
deltree /y "%userprofile%\Recent\*.*"
deltree /y "%userprofile%\LocalS~1\Temp\*.*"
deltree /y c:\_restore d:\_restore o:\_restore
cls
编辑 - 我已经知道并且看到很多其他人提出了同样的问题,但没有一个人有正确或100%的工作答案,所以经过几个小时的测试和尝试我终于完成了它。
Windows 10 Temp Cleaner
FOR /D %%p IN ("%systemroot%\temp\*.*") DO rmdir "%%p" /s /q
del %systemroot%\temp\*.* /F /Q
FOR /D %%p IN ("%systemroot%\system\*.tmp") DO rmdir "%%p" /s /q
del %systemroot%\system\*.tmp /F /Q
FOR /D %%p IN ("%systemdrive%\*.tmp") DO rmdir "%%p" /s /q
del %systemdrive%\*.tmp /F /Q
FOR /D %%p IN ("%systemroot%\*.tmp") DO rmdir "%%p" /s /q
del %systemroot%\*.tmp /F /Q
FOR /D %%p IN ("%systemroot%\Prefetch\*.*") DO rmdir "%%p" /s /q
del %systemroot%\Prefetch\*.* /F /Q
FOR /D %%p IN ("%userprofile%\LocalS~1\Temp\*.*") DO rmdir "%%p" /s /q
del %userprofile%\LocalS~1\Temp\*.* /F /Q
FOR /D %%p IN ("c:\_restore d:\_restore o:\_restore") DO rmdir "%%p" /s /q
del c:\_restore d:\_restore o:\_restore /F /Q