'Xcopy when source folder name is incremented each time

I am trying to copy files via a .bat file on a scheduled basis. I know how to handle all of it except 1 piece - the issue is the source folder name is different each time. the first time it's C:\folder\new. Second time it will be C:\folder\new-0001, then C:\folder\new-0002. How do I account for the source folder changing?

This is Cerbot SSL renewal as standalone. Tomcat on Windows.

I plan to stop the webservice, renew the cert (which creates the new folder of new files), copy the files to Tomcat, then start the webservice.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source