Solved

Delete group of files

Posted on 2004-09-09
1
202 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
ID: 12017568
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

12 Experts available now in Live!

Get 1:1 Help Now