Simplest solution:
Scripting::IFileSystemPtr fs(__uuidof(Scripting::FileSystemObject));
fs->__DeleteFile(L"c:\\dmmm\\df\\*", _variant_t(false));
Showing a whole simplistic program:
#include <objbase.h>
#include <comutil.h>
#undef GetFreeSpace
#import <scrrun.dll> auto_rename
int main()
{
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
try
{
Scripting::IFileSystemPtr fs(__uuidof(Scripting::FileSystemObject));
fs->__DeleteFile(L"c:\\dmmm\\df\\*", _variant_t(false));
}
catch (const _com_error&)
{}
CoUninitialize();
return 0;
}
</scrrun.dll></objbase.h>