Question

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.

Was it helpful?

Solution

you probably want to do

DIR /S /B .#*.*

to list out the directories recursively

OTHER TIPS

I think you need DEL /S

What about this:

FOR /R C:\FOLDER\SUBFOLDER %%G IN (.#*.*) DO DEL %%G
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top