0

Is there something that can go instead of ??? here to make this work?

del D:\folder*.ext if ??? goto fail

Else what's the better way to branch in fail? I'm hoping there's better than using a FOR loop.

MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
ChrisJJ
  • 2,191
  • 1
  • 25
  • 38

1 Answers1

1
@echo off
del "D:\folder\*.ext" 
if exist "D:\folder\*.ext" goto :fail
goto :EOF

:fail
echo "D:\folder\*.ext" wasn't deleted
pause
foxidrive
  • 40,353
  • 10
  • 53
  • 68
  • Thanks. I can't find any documentation to say that wildcards are allowed in the FilenName parameter, but it works, so I'll got with it! – ChrisJJ Jun 08 '13 at 13:11