1

Im having an issue replacing DELTree command I wrote a small batch file like 12 years ago or something for windows xp and ME and I want to use it on windows 10 to clear TEMP files and PREFETCH and others I would appreciate it if you tell me what is the replacement for the command

@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 

EDIT- I already know and saw many other people asked same question but none had a correct or 100% working answer so after couple hours of testing and trying i finally go it done. 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
  • m$, when it's not busy ramming win10 down your throat, would probably say to use powershell and not batch/cmd anymore. – Marc B Jun 09 '16 at 21:47
  • 1
    You are searching for `del` and `rmdir` -- both commands feature a `/S` switch for recursive operations; open a command prompt window and type `del /?` and also `rmdir /?`... – aschipfl Jun 09 '16 at 22:28
  • 1
    You might also be interested in [this](http://stackoverflow.com/a/17097668)... – aschipfl Jun 09 '16 at 23:28

0 Answers0