• replacement for deltree

    Author
    Topic
    #2323706

    I want to run my old file from Fred Langa to clean things up. I looked at it and see my footprints of having tried this before with win10 and failing.

    C:\Users\*****\AppData\Local\Temp del /s /q *.* gets rid of files but leaves the folders, which probably have stuff in them. I have tried various versions of RD but no go. Apparently there was an alternative for deltree but can’t find it. What do folks do? Thanks!!! (I just do local/temp and windows/temp.

    Viewing 3 reply threads
    Author
    Replies
    • #2323737

      I just did it manually, but still wondering if there’s a command line for it…

      • #2323804

        When using RD (RMDIR) appending /S will delete a directory tree, /Q will do it quietly.

        The problem is that RD will remove happily remove the Temp directory, so this brute force method below will work but it is not the better way. I tried to automate this with complicated batch language commands but there does not seem to be any provision for detecting errors.

        SET d=%Userprofile%\AppData\Local\Temp\
        RD /Q /S %d%
        MD %d%

        After testing this recreated Temp directory will have correct read/write permissions for the User. I’m not sure that special user’s permissions will be added after recreating the Temp directory under C:\Windows. Please let me know if the any special users permissions are recreated after making the C:\Windows\Temp directory.

        P.S. There may be a better way at the end if this blog post.

        1 user thanked author for this post.
    • #2323852

      Yeah. Thanks. It appears that rmdir or rd will in fact do what deltree did but you have to back up a directory (cd..) before doing it and then identify that directory (temp) in the command (rmdir /s temp ). (In other words you can’t sit in a directory (temp in this case) and issue rmdir /s * as it simply won’t work.)  That will in fact delete the temp directory, which I was trying to avoid doing, thinking it might somehow hurt things, but apparently windows just recreates it on the fly next time it needs it. I tested this on windows/temp and it worked. I will later have to test it on the local/temp when it gets junk in it, but, if true, that makes (Langa bat file) life very easy!

    • #2323857

      further thoughts: local/temp has ALSysIO64.sys file in it which is used by coretemp which I run. I added a test folder and test file and then ran rmdir /s temp in local and it (as I had hoped) left the ALSys file but deleted the rest. This means I don’t need to do the del /s/f/q *.* first. Just go to one directory above temp and execute rmdir /s temp. Better be very sure what you are doing here!!!!!!!!!!!!!!!!!!! Never use /Q on this one!!!

    • #2324183

      Just tested. Works for me.

      @echo off
      cls
      echo idea from Fred Langa’s CleanXP Script For WinME/2K/XP
      C:
      cd “C:\Users\*****\AppData\Local”
      rmdir /s Temp
      c:
      cd “C:\Windows”
      rmdir /s Temp
      pause
      cleanmgr /sagerun:99
      :: The above line assumes you’ve previously run a “cleanmgr /sageset:99”
      exit

      • This reply was modified 4 years, 4 months ago by a.
    Viewing 3 reply threads
    Reply To: replacement for deltree

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: