I'm new to using C++ but I thought I would give it a try. The goal is to delete all files and folders located in %userprofile%\Local Settings\Temp without deleting the folder called "Bluezone" located in the Temp folder. Any help would be appreciated.
iDevelop
1
Newbie Poster
Excizted
commented:
Theanks for repping. Also keep up with the friendly questions :)
+1
Recommended Answers
Jump to PostI'm new to using C++ but I thought I would give it a try. The goal is to delete all files and folders located in %userprofile%\Local Settings\Temp without deleting the folder called "Bluezone" located in the Temp folder. Any help would be appreciated.
Theres several ways you could do this …
Jump to PostFiles too. Sorry I forgot to mention that.
Then with the windows header (windows.h) you can use FindFirstFile.
Example of usage:
WIN32_FIND_DATA findFileData; HANDLE hFind; hFind = FindFirstFile((LPCSTR)"C:\\Users\\Local Settings\\Temp\\*", &findFileData); if(hFind != INVALID_HANDLE_VALUE) { string filename(findFileData.cFileName); cout << filename; } while(FindNextFile(hFind, &findFileData)) { string filename(findFileData.cFileName); cout …
All 5 Replies
Excizted
67
Posting Whiz
iDevelop
1
Newbie Poster
Excizted
67
Posting Whiz
iDevelop
1
Newbie Poster
Excizted
67
Posting Whiz
iDevelop
commented:
Thank You SO Much!!
+0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.