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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Script for adding text to filename

  • 26-12-2020 10:27am
    #1
    Registered Users, Registered Users 2 Posts: 1,183 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 Posts: 1,183 ✭✭✭tritriagain


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


  • Registered Users, Registered Users 2 Posts: 4,277 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 4,255 ✭✭✭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, Registered Users 2 Posts: 6,125 ✭✭✭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, Registered Users 2 Posts: 21,499 ✭✭✭✭Alun


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

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


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 182 ✭✭Philipx


    I use this a lot for photo etc

    Batch File Renamer


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


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


Advertisement