OK, first here is a snippet of code from a high level language that will recursively go through the directories. So if your looking for that you can convert it to any language you want. I think this is Clipper but can't be sure. I couldn't find reference in the code for the mentioned filedelete() function, but I imagine it does the work when a directory hit is made, I think it's a UDF. Table is an array. Some functions are base program functions (DELFILE,DIRECTORY) I can't really say, but when you use your language just use the equivalent.
The problem with DOS is not doing the work, that it will do without any problems. The problem is when it needs to talk to you and your calling it from a VBasic or something. So I think you will need to pipe a "Y" before your command so you don't get a "Delete Yes or N?" or something like that. Something like if you were copying over an existing file, dos would ask you if that's OK, so you would say:
"Y" | copy xxxxx to cccccc
you'll need to check the syntax in windows to get the right syntax.
Meanwhile, I'll find the same thing for DOS. I have a gazillion examples of DOS, even how to compile a batch file to make an exe, so it'll take me time to research.
function delfile(cur_path)
local table := {}, i
filedelete(cur_path +"*.*",0)
table := DIRECTORY(cur_path+"*.*","D")
if len(table) > 0
for i := 1 to len(table)
if !(left(table[I,1],1) $ ".")
DELFILE(cur_path + table[i,1] + "\") //Recursive to reach the
dirremove(cur_path+ table[i,1]) // lowest sub-directory
endif
next
endif
return nil