Try this -
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
int main()
{
DWORD dwDesiredAccess = GENERIC_ALL; // or ask for DELETE with other desired permissions
HANDLE hFile = CreateFile(TEXT("Badfile.txt"), dwDesiredAccess, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
// Oops! Something bad happened
FILE_DISPOSITION_INFO fdi = { static_cast<BOOLEAN>(TRUE) };
SetFileInformationByHandle(hFile, FileDispositionInfo, &fdi, sizeof fdi);
CloseHandle(hFile);
}
return 0;
}