Can someone provide a batch script that will delete all but the X most recently modified folders in a directory. I've looked at How do I delete old files from a directory while keeping the most recent ones on Windows, but that was based on an absolute time window rather than a relative ordering of modification dates.
Thanks for any help