Hi Gulhasan.Siddiquee ,
Thankyou for using Microsoft Q&A platform and thanks for posting your question here.
As I understand your query, you are trying to delete only few selected files from the folder. Please let me know if my understanding is incorrect about the query.
Instead of iterating through the files that you want to delete, you can either use 'wildcard file pattern' to delete the files in case your filenames which you want to delete shares a common pattern , or else, if the filenames doesn't have any matching pattern, you can use 'list of files' option where you need to point to a file which contains all the filenames you want to delete:
For implementation, kindly checkout the below video where it's about copying the files, but same logic goes with deleting as well:
Hope it helps. Kindly accept the answer if it's helpful. Thankyou