either use pro/toolkit function to get a ProArray of all files in a directory and extract entries matching name and/or extension from ProArray
ProFilesList(...)
or use
#include <filesystem>
std::filesystem::directory_iterator
something like this (verify spelling and function names with cpp reference):
std::filesystem::path p{"directory_in_question"};
std::wstring base_name{"drawing_name_in_question"};
std::vector<std::filesystem::path> delete_me;
for (auto const& dir_entry : std::filesystem::directory_iterator{p}){
if( dir_entry.path().stem().extension().wstring().find(L"drw") == std::wstring::npos){
continue;
}
if( dir_entry.path().stem().stem().wstring() != base_name)
continue;
delete_me.push_back(dir_entry.path());
// or std::filesystem::remove( dir_entry.path())
}
std::for_each(delete_me.begin(), delete_me.end(),
[](auto &p) { std::error_code ec; std::filesystem::remove(p, ec); });