Skip to content

Instantly share code, notes, and snippets.

@NobleUplift
Created September 5, 2015 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NobleUplift/8c9e3b524284ac766b63 to your computer and use it in GitHub Desktop.
Save NobleUplift/8c9e3b524284ac766b63 to your computer and use it in GitHub Desktop.
Recursively remove directories of the same name from a hierarchy. Useful for PaxHeaders.
@ECHO OFF
SET DIRECTORY=%1
REM PaxHeaders.12345
SET REMOVE=%2
FOR /R %DIRECTORY% %%F IN (.) DO (
IF EXIST %%F\NUL (
RMDIR /S /Q %%F\%REMOVE%
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment