User Help

Windows 10 CMD Batch How to delete specific folders [closed]

Iv’e got a directory
and in that directory is a whole heap of folders, i want a batch file to delete all the folder with forge anywhere in there name.

there are no subfiles in these folders, but there are 2 files in each… i want anything in that directory with forge in it’s name deleted automatically with a batch file.

so delete all folders including forge in there name. i cant seem to do it.

This is all i know so far ^^^

I have tried googling stuff, but i cant remember everything i have tried… but here is some.

rmdir /s %userprofile%\appdata\roaming.minecraft\versions

for /d /r . %d in (forge) do @if exist “%d” rd /s/q “%d”

also tried this (below) but it only listed the folders and files i want deleted.

dir “%userprofile%\appdata\roaming.minecraft\versions” /s /b /d | find “forge”

Leave a Reply

Your email address will not be published. Required fields are marked *