DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: DONE: Program to automatically delete files with specified file extensions.  (Read 12,289 times)

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 9
When I launch this program, I would like for it to ask me to brows to a folder of my choosing. once I do this, the program could show me a list of file extensions in that folder, and allow me to check the ones I wish to delete. When I click finish, the program will delete any file with those specified extensions from that folder. Reason I want this is there are some folders on my computer I wish to filter in this way. Hope this isn't too difficult to code and that someone will be able to help out! Thank you guys!

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
You could accomplish the same thing with FreeCommander.  Navigate to a folder. At the bottom status bar there's a small input box that says "quick filter" when you mouse over it.  Put in what you want to delete such as *.jpg or whatever, only those will be shown.  Control-A to select them all.  Hit delete key.  Put in a different filter if you like to continue with another extension.

http://www.freecommander.com/fc_downl_en.htm

Plus the program has a lot of other nice features.  Sadly it's only compiled in 32 bit.

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,840
    • Coding Snacks
this functionality probably exists in most 3rd party file managers

in total commander the numpad '+' key brings up the filter select dialog and you can enter a choice manually, or pick from a list of options (audio, video, archives, etc)
Alcohol is photoshop, bottled
Askhole - someone who ask for advice, then ignores it
"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler

sajman99

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 664
There are a number of free search tools like those mentioned in this DC thread which can search the entire disk in mere seconds, if not milliseconds.

For example, with the search tool Everything you need only type .jpeg to find all instances of the .jpeg file extension on your system. Then you will have direct access to those files so you can delete whatever you choose. It's really so simple and fast it's truly amazing.

Also, many of these tools have optional context menu integration so that you can choose to search a specific folder.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Here you go (source/binary included): Download

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 9
Thanks for the program, and for the great suggestions! You guys are truly awesome!

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
You're welcome.  Glad it's working for you.

Original address: https://www.donationcoder.com/forum/index.php?topic=22014.0