Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Delete group of files

Posted on 2004-09-09
1
Medium Priority
?
209 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 45

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 …
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

636 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