Windows 10: Recursively Delete File Types From A Named Folder Only

Discus and support Recursively Delete File Types From A Named Folder Only in Windows 10 Network and Sharing to solve the problem; I have a weekly cleanup routine I want to setup where I scan an entire directory of users folders and delete file types *.psr and *.zip but only in... Discussion in 'Windows 10 Network and Sharing' started by Pmc181, Jun 10, 2020.

  1. Pmc181 Win User

    Recursively Delete File Types From A Named Folder Only


    I have a weekly cleanup routine I want to setup where I scan an entire directory of users folders and delete file types *.psr and *.zip but only in certain folders. Not every sub-folder.


    Each user's folder in this directory has a sub-folder named the exact same name for all users. I only want to delete these files in the named sub-folder of each user. In the screen shot example below it would be the Target-Folder. The Target-Folder name exists for all users.


    I came up with this Del statement to run and it works but deletes those file types from all sub-folders and not just the Target-Folder for each user.


    DEL /S /Q *.psr *.zip > Deleted-psr-zip.txt 2>&1


    Recursively Delete File Types From A Named Folder Only 3358fa91-8089-40e2-9cac-4ad6bbe5311c?upload=true.jpg
    Thanks,

    Pmc181

    :)
     
    Pmc181, Jun 10, 2020
    #1
  2. topgundcp Win User

    Unable to delete a folder - Invalid folder name


    Suggestion:
    1. Run chkdsk x: /r to make sure that there's no HD corruption.
      x: is the drive containing the folder you want to delete.
    2. Try to delete the folder again. If still does not work, go to step 3.
    3. Download: Download - Linux Mint and create a bootable USB using: Rufus - Create bootable USB
    4. Boot up with Linux Mint and try to delete the folder again.
      NOTE: Unlike WinPE. Linux does not have any Windows permission imposed to it so it is easier to delete.
     
    topgundcp, Jun 10, 2020
    #2
  3. Trouble deleting a folder

    Thanks for the suggestion but it says "delete folder failed for E:\....." for each folder I try.

    *Confused Recursively Delete File Types From A Named Folder Only :confused:

    Will I be forever stuck with these unnecessary folders? *Oh Well Recursively Delete File Types From A Named Folder Only :eek:hwell:
     
    oli_ramsay, Jun 10, 2020
    #3
  4. Anusha Win User

    Recursively Delete File Types From A Named Folder Only

    C windows installer folder - Delete?

    He can do symbolic link redirection and move the files in it to a different location. *Wink Recursively Delete File Types From A Named Folder Only ;)
    Better try it out in a virtual of first. Just a suggestion.

    Like:
    First move everything in c:\windows\installer to d:\installercache
    Then delete c:\windows\installer folder
    Then type this in command mode as admin
    mklink /d c:\windows\installer d:\installercache

    Removing those installer files is a bad idea. it might prevent you from updating or uninstalling apps.
     
    Anusha, Jun 10, 2020
    #4
Thema:

Recursively Delete File Types From A Named Folder Only

Loading...
  1. Recursively Delete File Types From A Named Folder Only - Similar Threads - Recursively Delete File

  2. There is a folder named virus and only trustedinstaller can delete it

    in Windows 10 Gaming
    There is a folder named virus and only trustedinstaller can delete it: Please Help idk how to delete it https://answers.microsoft.com/en-us/windows/forum/all/there-is-a-folder-named-virus-and-only/a93a772f-38f3-4e7c-b98f-ec8b2eec9682
  3. There is a folder named virus and only trustedinstaller can delete it

    in Windows 10 Software and Apps
    There is a folder named virus and only trustedinstaller can delete it: Please Help idk how to delete it https://answers.microsoft.com/en-us/windows/forum/all/there-is-a-folder-named-virus-and-only/a93a772f-38f3-4e7c-b98f-ec8b2eec9682
  4. There is a folder named virus and only trustedinstaller can delete it

    in Windows 10 Network and Sharing
    There is a folder named virus and only trustedinstaller can delete it: Please Help idk how to delete it https://answers.microsoft.com/en-us/windows/forum/all/there-is-a-folder-named-virus-and-only/a93a772f-38f3-4e7c-b98f-ec8b2eec9682
  5. Deleting recursive folders - file path too long

    in Windows 10 Gaming
    Deleting recursive folders - file path too long: When trying to remove certain recursive folders, I get this error.rmdir : The tag present in the reparse point buffer is invalid. At line:1 char:1 + rmdir FolderName+ ~~~~~~~~~ + CategoryInfo : WriteError: C:\Users\... [Remove-Item], IOException + FullyQualifiedErrorId :...
  6. Deleting recursive folders - file path too long

    in Windows 10 Software and Apps
    Deleting recursive folders - file path too long: When trying to remove certain recursive folders, I get this error.rmdir : The tag present in the reparse point buffer is invalid. At line:1 char:1 + rmdir FolderName+ ~~~~~~~~~ + CategoryInfo : WriteError: C:\Users\... [Remove-Item], IOException + FullyQualifiedErrorId :...
  7. Deleting recursive folders - file path too long

    in Windows 10 Network and Sharing
    Deleting recursive folders - file path too long: When trying to remove certain recursive folders, I get this error.rmdir : The tag present in the reparse point buffer is invalid. At line:1 char:1 + rmdir GoK + ~~~~~~~~~ + CategoryInfo : WriteError: C:\Users\... [Remove-Item], IOException + FullyQualifiedErrorId :...
  8. File Explorer is generating a recursive list of files in a folder.

    in Windows 10 Network and Sharing
    File Explorer is generating a recursive list of files in a folder.: One of my directories has a sub-folder that contains another folder with the same name. It contains a sub-folder with the same name and this goes on and on I assume for hundreds of levels. I can create a new folder in a sub level and it automatically creates the same folder...
  9. Names of permanently deleted files and folders.

    in Windows 10 Backup and Restore
    Names of permanently deleted files and folders.: is it possible to access Names of permanently deleted files in folder? I accidentaly removed lots of files in my downloads folder, as soon as TRIM is enabled on my SSD it was impossible for me to recover removed files, so I'm interested if its possible to see names of...
  10. recursively search C: for specific file-type type then copy w/Path

    in Windows 10 Support
    recursively search C: for specific file-type type then copy w/Path: Pretty much what it says in the Header. I am sure this can be done using the correct switched in several tools like robocopy or even X-Copy but so far copying the file including its full path to another location is not working properly for me. I think i have the recursive...