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:
cd toYourDirectory (or pushd toYourDirectory)
rd /q /s . 2> nul