On Fri, 12 May 2006 14:55:33 +0800, Man-wai Chang
<toylet.toylet@gmail.com> wrote:
>*ProteanThread* wrote:
>> looking for a util to delete all files in a given directory and
>> sub-directories but keep the directory structure intact?
>>
>
>I haven't tested it. SO be *CAREFUL*. Try:
>
>cd path
>del *.* /s
Better yet since it works in any directrory is:
DEL /S /Q C:FOO*.*
where C:FOO is an example of the first sudir you want
to include in the chain of subdirs. The /Q switch (quiet)
makes it automatic (no questions asked). It lists on
the screen all files deleted. Variations might be:
DEL /S /Q C:FOO*.* >NUL
to keep it perfectly quiet, or:
DEL /S /Q C:FOO*.* >FOO.TXT
to pipe the list of files deleted to a text file.
Yes, I have tested this on test subdirectory structures
in Win 2K and it works ok. Obviously, this sort of thing
is dangerous. Be very careful to type the path of the
first subdir exactly.