Solved

Delete group of files

Posted on 2004-09-09
1
201 Views
Last Modified: 2013-11-20
How can I delete a gruop of files using the '*' character?
I tried using CFile::Remove and invoking the del command with CreateProcess(...) but anyone delete the files.
I´m running the application on WNT.
Thanks
0
Comment
Question by:martin11_ar
1 Comment
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 100 total points
Comment Utility
Use CFileFind to find the files then the CFile::Remove

roughly

      CFileFind finder;
      BOOL bWorking = (finder.FindFile("*.*"));
      while(bWorking)
      {
            bWorking = finder.FindNextFile();

            CString FileToKill = finder.GetFileName();

            if(!finder.IsDirectory())
                  CFile::Remove( FileToKill );
      }
      finder.Close();
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now