Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Script for adding text to filename

Options
  • 26-12-2020 11:27am
    #1
    Registered Users Posts: 1,166 ✭✭✭


    i have numerous folders with files that i need to append to the file name.

    e.g old file name = application.pdf new file name = document application.pdf

    ideally i would like a a script that i can drag into the folder , run it and then it is done.

    any ideas.


Comments

  • Closed Accounts Posts: 2,910 ✭✭✭begbysback


    powershell


  • Registered Users Posts: 2,108 ✭✭✭boombang


    Make a .bat batch file with

    Ren "OldFileName.pdf" "NewFileName.pdf

    I think there are options for sub directories. Etc. Use print to get a list of all the relevant files to make your batch file from.


  • Registered Users Posts: 1,166 ✭✭✭tritriagain


    but wont that rename file completly i only want to add some text to the original name


  • Registered Users Posts: 4,275 ✭✭✭km991148


    but wont that rename file completly i only want to add some text to the original name

    On phone so can't test.
    Assuming windows:

    ren *.mp3 ?text.mp3

    Full example/ explanation from

    https://superuser.com/a/1006827


    But of course test in a dummy directory first!


  • Registered Users Posts: 2,108 ✭✭✭boombang


    km991148 wrote: »
    On phone so can't test.
    Assuming windows:

    ren *.mp3 ?text.mp3

    Full example/ explanation from

    https://superuser.com/a/1006827


    But of course test in a dummy directory first!

    This is better and more flexible, but will only be suitable if you want to rename all the files of a given extension.


  • Advertisement
  • Registered Users Posts: 2,108 ✭✭✭boombang


    but wont that rename file completly i only want to add some text to the original name

    Use a text editor to add what you want to the original file names. I'd recommend using notepad++ for a handy edit of the file names.


  • Registered Users Posts: 4,128 ✭✭✭smuggler.ie


    Have a look here


  • Posts: 0 [Deleted User]


    There is a (free for personal use) Bulk Rename utility... the interface is a bit of a mess but been using it for nearly 10 years and no problems.

    Once you get your head around the interface, it'll do just about anything you want - and you can also preview changes before committing.

    https://www.bulkrenameutility.co.uk/


  • Registered Users Posts: 5,979 ✭✭✭kirving


    And before running any automated script to rename stuff, copy the files to an external drive (or at least another folder) and do your work in a safe place.

    Then go back and replace the old files with the newly renamed copies.


  • Registered Users Posts: 21,465 ✭✭✭✭Alun


    This one I use, the free Lite version is plenty good enough.

    http://www.den4b.com/products/renamer


  • Advertisement
  • Registered Users Posts: 182 ✭✭Philipx


    I use this a lot for photo etc

    Batch File Renamer


  • Registered Users Posts: 2,997 ✭✭✭Adyx


    There's a Microsoft Power Toy called Power Rename that should do it.


Advertisement