I would like the functionality of rmdir /s but I need to keep the specified directory. rmdir /s removes all files and sub directories in addition to the directory specified.
I’ve also tried using del /s but then I am left with empty folders in the specified directory. I need those folders removed as well.
Any guidance on how I can do this?
Easiest way would be to change directory to specified directory and invoke an rd command on the “.” directory. Like:
on..
the error when the rd command attempts to remove itself (which is
what you want)