I have a folder being filled with auto generated files by an application. There are csv and png extensions being created and stored in there. We need to delete all files in the folder except certain png files where the filename starts with "abc-". The system is a windows server 2012 r2 box, and the goal is to have this done via a batch file using task scheduler every night.
I have tried using a couple of different scripts pre written, but would not exclude these prefixed png files, only remove all. How would I go about this?