Hello, I have recently been able to delete files using this code(With the aid of others from the forum) And I was wondering how you can change this, to suit deleting a folder
#include <iostream>
#include <windows.h>
int main(int argc, const char * argv[])
{
// Get a pointer to the file name/path
const char * pFileToDelete = "c:\\Program Files\\myfile.txt";
// try deleting it using DeleteFile
if(DeleteFile(pFileToDelete ))
{
// succeeded
std::cout << "Deleted file" << std::endl;
}
else
{
// failed
std::cout << "Failed to delete the file" << std::endl;
}
std::cin.get();
return 0;
}
Thank you