topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 2:54 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: prefix folder name with number of files within folder  (Read 6255 times)

tabzilla

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 13
    • View Profile
    • Donate to Member
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

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: IDEA: prefix folder name with number of files within folder
« Reply #1 on: May 26, 2019, 10:21 AM »
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, 10:50 AM by p3lb0x »

tabzilla

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 13
    • View Profile
    • Donate to Member
Re: IDEA: prefix folder name with number of files within folder
« Reply #2 on: May 26, 2019, 10:56 AM »
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
  • *
  • default avatar
  • Posts: 13
    • View Profile
    • Donate to Member
Re: IDEA: prefix folder name with number of files within folder
« Reply #3 on: May 26, 2019, 10:58 AM »
Oh, I just noticed "Requires .Net 4.6.1".  I'm just going to check if I have that.

tabzilla

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 13
    • View Profile
    • Donate to Member
Re: IDEA: prefix folder name with number of files within folder
« Reply #4 on: May 26, 2019, 11:01 AM »
I have .NET Framework 4.7.2

tabzilla

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 13
    • View Profile
    • Donate to Member
Re: IDEA: prefix folder name with number of files within folder
« Reply #5 on: May 26, 2019, 11:08 AM »
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
  • *
  • default avatar
  • Posts: 13
    • View Profile
    • Donate to Member
Re: IDEA: prefix folder name with number of files within folder
« Reply #6 on: May 26, 2019, 11:19 AM »
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

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: IDEA: prefix folder name with number of files within folder
« Reply #7 on: May 26, 2019, 11:27 AM »
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