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 Jul 2003 18:59:27 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com
(Spammay Blockay) wrote:

>In article ,
>Herman D. Knoble wrote:
>>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
>> subdirectories.
>>
>>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:
>
> %MYDIR%\myFile1.txt
> %MYDIR%\myFile2.cmd
> %MYDIR%\myDir1\file1.txt
> %MYDIR%\myDir2\abc
>
>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?
>
>- Tim