?
Solved

Delete group of files

Posted on 2004-09-09
1
Medium Priority
?
208 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
[X]
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
1 Comment
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 400 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

801 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