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: IDEA: prefix folder name with number of files within folder  (Read 11,142 times)

tabzilla

  • Participant
  • Joined in 2019
  • *
  • Posts: 13
e.g. Folder1 contains 16 files and Folder2 contains 8 files so their new names become "16 Folder1" and "8 Folder2".

I have been unable to find any existing programs which do this.

Thank you very much.

p3lb0x

  • Beer, beer, beer, I'm going for a beer!
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
    • Cody Award
    • Participated in NANY Challenge Once
Re: IDEA: prefix folder name with number of files within folder
« Reply #1 on: May 26, 2019, 03:21 PM »
Shouldn't be too horrible to do.

edit: Done diddly.

Pull any folder you want on to the executable and it will count the folders and files inside and rename the folder to "# OldFolderName". I put the sourcecode rar as well. If you want it for multiple folders at once that can be easily done.

Edit edit: Okay, added functionality to drop multiple folders in at once.

Requires .Net 4.6.1
Stop mousering people so much - Mouser
« Last Edit: May 26, 2019, 03:50 PM by p3lb0x »

tabzilla

  • Participant
  • Joined in 2019
  • *
  • Posts: 13
Re: IDEA: prefix folder name with number of files within folder
« Reply #2 on: May 26, 2019, 03:56 PM »
Thanks

I made a folder named "test" containing four textfiles and dropped it onto the exe and got this

"Checking: C:\Users\MyName\Downloads\test
4 found
Renaming test to 4 test
4 test already exists"

The folder remains unrenamed.

I would definitely appreciate one that can do multiple folders at once.

tabzilla

  • Participant
  • Joined in 2019
  • *
  • Posts: 13
Re: IDEA: prefix folder name with number of files within folder
« Reply #3 on: May 26, 2019, 03:58 PM »
Oh, I just noticed "Requires .Net 4.6.1".  I'm just going to check if I have that.

tabzilla

  • Participant
  • Joined in 2019
  • *
  • Posts: 13
Re: IDEA: prefix folder name with number of files within folder
« Reply #4 on: May 26, 2019, 04:01 PM »
I have .NET Framework 4.7.2

tabzilla

  • Participant
  • Joined in 2019
  • *
  • Posts: 13
Re: IDEA: prefix folder name with number of files within folder
« Reply #5 on: May 26, 2019, 04:08 PM »
Do you mean it requires Requires .Net 4.6.1 or later, or would I be better to roll my version back?  Thanks.

tabzilla

  • Participant
  • Joined in 2019
  • *
  • Posts: 13
Re: IDEA: prefix folder name with number of files within folder
« Reply #6 on: May 26, 2019, 04:19 PM »
I downloaded the one you uploaded first and wrote a reply without seeing your edited post from six minutes previously.  I downloaded the second version and it works perfectly.  Thank you very much.

p3lb0x

  • Beer, beer, beer, I'm going for a beer!
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
    • Cody Award
    • Participated in NANY Challenge Once
Re: IDEA: prefix folder name with number of files within folder
« Reply #7 on: May 26, 2019, 04:27 PM »
Ah yes, I done goofed with the first one. Added in a check to make sure we don't try to move the directory to the same folder, but accidentally checked against the wrong variable :)
Stop mousering people so much - Mouser

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