Click here to Skip to main content
15,917,328 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to delete all files with same strings in the file name at one time ?(not in the extern name)
Posted
Comments
Joezer BH 11-Jul-13 8:24am    
What do you mean when you write "extern name"?
Do you mean to delete files that contain the same given path or part of a path?
Richard MacCutchan 11-Jul-13 8:37am    
Use one of the file search functions to enumerate all the files in a path and filter the ones that you are interested in into a list, then delete all those in the list.
zhouxman 25-Mar-14 2:38am    
OK
zhouxman 19-Jul-13 3:06am    
what about the code?

CString bomfilename=path_str+_T("*.bom.*");
CFileFind finder;
BOOL bWorking ;
bWorking = finder.FindFile(_T(bomfilename));
  while(bWorking)
  {
  bWorking=finder.FindNextFile();
 CString strFilePath=finder.GetFilePath();
DeleteFile(_T(strFilePath));
  }

1 solution

you need to specify the full path and name. This also includes the extension.

write some code before asking and copy it to the question :mad:
 
Share this answer
 
Comments
zhouxman 12-Jul-13 9:51am    
tks,how the code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900