This is a discussion on Re: Is there ANY way in DOS to rmdir a tree using wildcards? - Microsoft Windows ; You should be able to do this using a deltree on the directories in mydir. set your location to %mydir% for /d %d in (*) do deltree "%d" Check the switching on deltree, you might need some On Thu, 31 ...
You should be able to do this using a deltree on the directories in
set your location to %mydir%
for /d %d in (*) do deltree "%d"
Check the switching on deltree, you might need some
On Thu, 31 Jul 2003 18:59:27 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com
(Spammay Blockay) wrote:
>Herman D. Knoble
>>For Windows NT/2000/XP issue the command: del /?
>>See if the /S command will help.
>>That is del c:\test\*.* /s will delete all files in c:\test and all c:\test's children
>>Then issue: rmdir c:\test /s
>>to remove the empty folders.
>Thanks for your help, Herman, but I think I may not have
>made myself clear.
>In this case, I have a directory stored in the variable
>name %MYDIR%. In %MYDIR% there exists a bunch of files,
>and some directories, who's names I do not know.
>I need to delete all the subdirectories in %MYDIR%,
>and all the files in those subdirectories (ie. the
>entire directory tree of each of these directories),
>BUT NOT ANY OTHER FILE in %MYDIR%.
>So, if I've got:
>Then the directory trees %MYDIR%\myDir1 and %MYDIR%\myDir2
>should be deleted, but nothing else.
>Any way you can think of doing this in a batch file?