Delete files which matches to the pat tern
Posted: 25 Jun 2010 01:26
How can I delete files which matches to pattern for example I have folder with files
test.txt
some_image.bmp
test
setup.exe
test a1
now I want to delete files which name contain word “test” so this will by three files
test.txt
test (file don’t have extension)
test a1 (file don’t have extension)
I have loop
but condition is bad how to fix that?
test.txt
some_image.bmp
test
setup.exe
test a1
now I want to delete files which name contain word “test” so this will by three files
test.txt
test (file don’t have extension)
test a1 (file don’t have extension)
I have loop
Code: Select all
for /f "delims=" %%a IN ('dir /b') do (
if "%%a"=="test*.*" (
del %%a
)
)
but condition is bad how to fix that?