| | |
Can't delete file on harddrive!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2005
Posts: 14
Reputation:
Solved Threads: 1
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...
If you guys could give me any ideas or suggestions i would greatly appreciate it. thx.
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...
C++ Syntax (Toggle Plain Text)
#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.
•
•
Join Date: Nov 2004
Posts: 15
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by bombe
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...
C++ Syntax (Toggle Plain Text)
#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.
![]() |
Similar Threads
- can't delete file need help please (Windows NT / 2000 / XP)
- Cannot delete file (Windows 95 / 98 / Me)
- Can't Delete File!!! (Windows NT / 2000 / XP)
- Explorer 'crashes' when trying to delete a file (Windows NT / 2000 / XP)
- cannot delete file/file in use by other program (Windows NT / 2000 / XP)
- cannot delete file (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: not executing an input from fstream
- Next Thread: Rapid XOR'ed encryption cracking.
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





