I am trying to use a batch file to delete all files with a given name in all subdirectories under a subdirectory. I basically have a folder with thousands of folders with GUID names that have a file that needs to be removed from each of them regularly, and I donβt want to continue searching and deleting.
typical subfolders are as follows:
C:\folder\{000D5D3E-A54D-4B0B-8B03-95AC591CB20A}\ C:\folder\{00DBFD07-3218-4DC2-83CA-27A7D14D782C}\ C:\folder\{00A08715-0811-6142-50AE-82A332EA3A5F}\ ...etc
and I want to remove:
C:\folder\{000D5D3E-A54D-4B0B-8B03-95AC591CB20A}\log.xml C:\folder\{90DBFD07-3218-4DC2-83CA-27A7D14D782C}\log.xml C:\folder\{A0A08715-0811-6142-50AE-82A332EA3A5F}\log.xml ...etc
This is what I still have .. but I can't get it to work .. any suggestions?
SET _DIR_="C:\FOLDER" SET _PATTERN_="C:\folder\{*}\log.xml" C: CD %_DIR_% for /r /%f in (%_PATTERN_%) do ECHO "%f"
Thanks. Just answer how to do this in a batch file =)
source share