Hi viewers,
I was trying to delete a file from my hard drive and I don't really have a good place to start. I googled it and came up with a code derived from multiple sources. I was wondering if anyone could help me out with the code to delete files from anywhere in your hard drive. Doesn't matter what file it is because this code is for a bigger program i'm trying to create. Here's my code so far...
#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow);
int main()
{
cout <<"Deleting file...";
system("del C:\Program Files\filedel.txt");
MessageBox(NULL, "File Deleted!", "Alert!", NULL);
return 0;
}
If you guys could give me any ideas or suggestions i would greatly appreciate it. thx.