Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Delete group of files

Posted on 2004-09-09
1
204 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 94
Change owner from userA to server Local Administrators 7 66
canBalance challenge 34 98
Work with App store 7 68
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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