I need to delete all the folders in current directory that starts with say “foo” followed by date
for example we have
- foo20120620
- foo20120513
- fooblabla
I can successfully delete one folder that matches current date
example
set FOO_FOLDER=%CD%\foo%datetimef%
echo Y | rd /s/q %FOO_FOLDER%
But I’m not able to delete all the folders starting with foo.
I have been tried something like
set OLD_PATTERN="%CD%\foo"
del %OLD_PATTERN%*
I have googled and tried to follow some questions already being asked in this forum , but those doesn’t help me a lot.
Any suggestion will be of great help to me.
must be in batch scripting on windows side.
You could use the
FOR /Dcommand.