0

My folder structure as follows

E:\test1\42\5440001\5338023\html E:\test1\43\5440021\5338024\html E:\test1\47\5440021\5638024\html E:\test1\43\5448721\5339024\html 

and so on...

Wherein HTML folder, ABC named sub-folder (common name in all folders) requires to delete.

Can any body help me on this by providing BAT script to delete all ABC sub folders in single shot.

Thanks in advance

1 Answer 1

1

Try this.

@ECHO OFF CD "E:\test1" FOR /D /R %%A IN (*ABC) DO RMDIR /S /Q %%A 

Before you actually run the above script to delete the folders, you can confirm you'll be deleting the right ones with this script.

@ECHO OFF CD "E:\test1" FOR /D /R %%A IN (*ABC) DO ECHO %%A 

I'd highly recommend running the second script first just to make sure you only get the folders you want.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.