Need to delete folder

Microsoft Windows xp professional w/serv...
June 21, 2010 at 07:37:59
Specs: Windows XP
I am trying to create a batch file that will delete any folders that contains 1.4 or 1.5

So far I got this

rmdir /s /q "C:\Millennium\jre\1.4.1_02"
rmdir /s /q "C:\Millennium\jre\1.5.0_12"

But I want to be less specific and delete any folders that contains 1.4 or 1.5 in the name field

Or maybe to delete any folders that do not contain 1.6 in the name...


See More: Need to delete folder

Report •


#1
June 21, 2010 at 08:05:44
@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('dir/b/s/ad ^| find "1.4"') do (
rd /s /q %%a
)

and so on


=====================================
Helping others achieve escape felicity

M2


Report •

#2
June 22, 2010 at 11:53:31
Mechanix2Go: dir/b/s/ad ^| find "1.4"
dir /b/s/ad "*1.4*"


Report •

#3
June 23, 2010 at 02:14:28
Hi R2,

I'm sure you're right. I just can't lose them old habits from DOS.


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
June 23, 2010 at 05:19:56
Thanks M2 and R2, it works like a charm, this really helped!!!

Report •

#5
July 15, 2010 at 17:42:19
Where we need to use this command please?Is it in a notepad or command prompt.Please guide on this....Thank you

Report •

#6
July 15, 2010 at 17:46:42
"notepad" (ie: a textfile with an extension of .bat)

Report •

Ask Question