How to delete N files of X type from Y subfolders from a Windows batch file?

I'm trying to write a windows batch file that can delete files from subdirectories. I would rather not hard code the directory structure in, so I can use this process with other projects.

  • I need to delete files of X type,
  • I have the parent folder C:\MyProject,
  • There are Y subfolders C:\MyProject\?,
  • There are N files to delete.

Is there a quick del (of type) function I am simply missing?

Answers


Actually you can use the standard del command:

c:
cd MyProject
del /S *.type

Where type is the extension you want to delete and the /S parameter will check in all subfolders of MyProject.


Need Your Help

C#/WPF: LineGeometry with nested UI Elements

c# wpf visual-studio visual-studio-2010

I am having problems using LineGeometry for drawing a path between two simple shapes nested in canvas elements.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.