How can I rename all files in folder easily?

Created by doe3879 on March 25, 2012, 4:13 a.m.
  • I'm a bit of folder phobic and I ended up putting all my files and phones in their folders. Now I want most of them combine into one folder so that I can hear them all more easily.

    The problem is that I named everything inside of the folder 01, 02, 03 ... etc. When I copy them all them, the file names conflict. Window does offer to rename the files but it only adds (1), (2) at the end of the file names and I ended up with a disorganized list of 01(1), 01(2), 01(3)...and so on.

    Is there anyway to rename everything inside a folder with a subtext at the begging of the files name? Something like "folder name" - 01.

  • I'm assuming Windows Vista or Windows 7.

    Open up a new Notepad window.

    cd C:\Directory\Path\To\Files\You\Want\To\Rename
    foreach ($file in $files) {

    Save this as "script.ps1" on your desktop. Make sure to change the "Save as Type" box from "Text Documents" to "all Files" so it doesn't give an extension of .txt. After that, go to your desktop and run it. You should then safely be able to copy over all of your files.

    Please make sure that you're renaming to the right things. You don't want to end up with Folder Name -01 as opposed to Folder Name - 01.

    There is another way of doing this that could also do the copying, but I'd recommend this as there are only two things to change, and there is less to go wrong.

    There might be some fancy software version to do this with a GUI if you're afraid of running a script. I ran this script on a test folder and it worked fine.

  • Oldie but a goodie for Windows.

  • Thanks for all the suggestions. Ken rename seem to be most easy to use so I'll mess around with that.

    I tried MAGZine's "script.ps1" but I couldn't get it work probably. I did changed the directory and deleted the .txt and renamed it as "script.ps1". The NotePad icon change to something else but when I click on it, it still just open in a notepad. Interesting tho, never knew you could write simple scripting macro like that in window.

  • Bulk Rename Utility

    use it all the time at work and at home

  • To make MAGZines script work. That doesn't need to be a batch file (.bat) file does it?

  • @GTFShadow said:

    To make MAGZines script work. That doesn't need to be a batch file (.bat) file does it?

    It is a Windows PowerShell script. It is much better then .bat files.

  • @Viderian: Yeah but im pretty sure PowerShell is something you have to grab separately.

  • @Viderian: Ok :). I wasn't sure, I will leave this stuff up to you guys. I still need to do some more learning of this xD

  • Start > Run > cmd

    Navigate to the directory you want.

    Issue the following command, changing Prefix_ to whatever you want.

    C:\TEST>for /f "tokens=* delims= " %a in ('dir/b *.*') do (ren "%a" "Prefix_%a")

  • @LtSquigs: powershell has been standard issue since Vista.

  • I would like to suggest you a program called "KrojamSoft BatchRenameFiles Tool"
  • This is a really old thread, but I'd like to put in my 2 cents. If you're on PC, Total Commander is a fantastic replacement for the stock explorer. It's fast and has many built in functions that make life really easy. Also multi-rename is amazing in TC.

  • In situations like this I use BatchRenameFiles Tool which I often suggest as well with confidence. Thanks

  • Are you looking how to batch rename files.try KrojamSoft BatchRename.It is a great tool

  • If you're using Mac, Try out pathfinder to replace finder. It has a function that I love, batch rename. You select a group of files and then run batch rename and you can use regex to rename them or sort them into folders.

  • Yes, there is away, just try KrojamSoft BatchRename

  • You can rename all files in folder easily by BatchRenameFiles Tool. Just search google -BatchRenameFiles Tool