1

I'm writing a batch file to cleanup my source folders. I want to delete all wincvs generated files with a prefix of .#

FOR /F "tokens=*" %%G IN ('DIR /B .#*.*') DO DEL "%%G"

the problem I'm having is that it's not deleting my files within subdirectories.

Kevin
  • 3,574
  • 10
  • 38
  • 43

3 Answers3

2

I think you need DEL /S

Ariel
  • 5,752
  • 5
  • 49
  • 59
1

you probably want to do

DIR /S /B .#*.*

to list out the directories recursively

mlathe
  • 2,375
  • 1
  • 23
  • 42
0

What about this:

FOR /R C:\FOLDER\SUBFOLDER %%G IN (.#*.*) DO DEL %%G
Rubens Farias
  • 57,174
  • 8
  • 131
  • 162