0
RMK

Utility Software to Bulk Rename Files

Recommended Posts

For my photos, I use the Batch Rename feature in ACDSee which works brilliantly. For my video files, I don’t have anything as useful and the native MS Windows bulk rename feature is s***.

Web searching on bulk rename utility programmes yields many pages of choices. Does anyone have a “best pick” of these software utilities with maybe a slant on photo/video files?
"Pain is the best instructor, but no one wants to attend his classes"

Share this post


Link to post
Share on other sites
Ideally accessible from a right-click, but having to open an executable is OK. Free is best, but I don’t mind paying for it if the software is good.

There’s no shortage of these programmes. One search gave a list of over 40 to choose from. I just don’t like indiscriminately downloading programmes I’m unfamiliar with or from unknown websites. Just wondering if anyone had found one that worked particular well.
"Pain is the best instructor, but no one wants to attend his classes"

Share this post


Link to post
Share on other sites

Tell me how you want it to work and i will make a software for you.
As i couldnt wait for your reply i have already done one version :$
You need MS excel and you need to enable macros.

Tell me what you think, and what could be changed

EDIT: I think this is roughly how Acdsee works, i dont have it myself but i googled how it works and as far as i could understand this is close

EDIT 2: You need to right click and save as on the file below

EDIT 3: LOL, it seems the file gets downloaded as a zip. Rename the file to RMK.xlsm and it should work

Share this post


Link to post
Share on other sites
Thanks, that works great! Much better than the Microsoft variant included in the OS. Very kind of you to put that together for me.

That fills my need, but if you were to tweak it, the only two items to change would allow to be able to choose what file number to start from (however starting from 1 will fulfill most needs) or possibly allowing for entry of #, ##, ### for number of digits (i.e. 1, 01, 001).

I don’t know if you do any freelance web/IT work, but I’ll PM you with my details as I may have some business-related projects for you if interested.
"Pain is the best instructor, but no one wants to attend his classes"

Share this post


Link to post
Share on other sites

Sure i will fix that.
Do you want the numbering to be automatic, so when you are renaming 5 files you will get name_#.
And when you rename 15 files you will get name_01 to name_15.
And if you ever do more than 99 you will get ###, or do you want to be able to choose the number of #´s?

About the numbering not starting from 1, simple.
Give me a few minutes.

The reason i made it a excel VBA project and not stand alone software is because *someone* :o broke my PC where i have all the development tools.
If i get it running i can rewrite the code to a stand alone software.

The cell A1 in sheet1 can be used to choose a startdirectory. So if you have all your videos in C:\Videos\Raw-files\ you could type that in the cell and the select-files window will automaticly start in that directory every time. ;)

Do you need a undo button?
I think i can make one if needed.

Share this post


Link to post
Share on other sites

Ok, I made the changes you asked for.
But i made made the software select the number of #´s.
So it should "make it look good" B|

There is a new textbox where you can type in the startnumber or use the spinbuttons (Up-Down arrows).
I have noticed one "problem" with that you can now choose the startnumber.
example:
Lets say you want to name them Video_5-Video_15, and you forget to change the startnumber.
That will restult in filenames will be Video_1-Video_10.
So if you just select the files again and try to rename them as Video_5-Video_15, it will "crash" because the file Video_5 already exists.

I recomend you to create a folder and a bunch of txt-files to play around with before messing something up.

The A1 cell in Sheet3 is now the one you choose startdirectory, if you use it.
I thought it looks nicer to have a clean sheet in the background.

Undobutton?

In the zip there is one xls (97-2003) and one xlsm (2007)
EDIT: ok, now there is a attached zip

Share this post


Link to post
Share on other sites
Good code. Might I suggest a file exists function that would prevent overwriting a file with the newfilename:

Public Function bFileExists(Sfile As String) As Boolean

If Dir$(Sfile) <> " " Then
bFileExists = True
Else
bFileExists = False
End Function

Then change your code:

newfilename = Replace(Files(a), OldFilename, UserForm1.TextBox1.Value & "_" & Number)
If Not bFileExists(newfilename) Then
Name Files(a) As newfilename
Else
i = MsgBox("New Filename exists, keeping old filename", vbCritical, "Something Horrible Happened")
End If
For the same reason I jump off a perfectly good diving board.

Share this post


Link to post
Share on other sites

I thought of that, but i really hate errormessages.
I only use them when i have no other way of solving things.

The errormessage will pretty much do the same thing as the VBA-crash. Just alert you of a problem.
The code cant owerwrite (at least it shouldnt) unless i do a 'on error go to next', that might cause problems.

What i think can be a solution is to reverse the code.
Instead of doing:
For a=1 to UBound(Files)
I could (if file exists) do:
For a=Ubound(Files) to 1 step -1

That will make the code start with Video_15 and go to Video_5.
I think that would work, at least i have not found a reason why it wouldnt yet :)And the three If´s that formats the value to "0", "00" or "000" will be changed.
I found a better, more efficient way, and it wont limit the user to 999 files.

Share this post


Link to post
Share on other sites
EDIT: Ok, i just realised i never tested this version before uploading it.
Lets just say, im working on it.


Ok, i think the final version is complete (unless someone finds a bug).

Changes since last version:
A undo-button has been added, it will undo the latest (1) action. But it will not redo what you undid.
The startvalue is not limited in any way (i belive) except it has to be numeric.
If you make the misstake as i explained in post above, it will not crash anymore. It will try to do the renaming reverse. If that also fails, it will alert you of the problem.
And since i noticed there is people reading my code ;) i added comments.
Alot of the coding has been simplified making it faster and easier to read (for humans).

I think thats about it.
I have not yet got the other computer running, so this will have to do for now.
Just tell me if you find any bugs or need any changes
:D

Share this post


Link to post
Share on other sites

The autorun is easy.
Make a txt-file in rootfolder of memorystick.
Write the following code in it:



[autorun]
open= >>>Drive:\Path\Filename.xls


Close the notepad and rename the file autorun.inf
In theory it should work :)
So you want it to copy and rename the files from the memorycard to your computer?
I dont think that should be a problem.
BUT, i know for a fact that when ms office does heavy work it will look as if its unresponsive, but its not. Its just working so hard that windows belives somethings wrong.

I will try to make the change for you.

Can anyone come up with a better name for this software? :)

Share this post


Link to post
Share on other sites

comments are overrated ;)

I did run into an error when it tried to ReDim Newfiles when you selected no files. The common dialog sets Files to false if you don't select any. I would suggest the following code change in your commandButton2 sub:


Private Sub CommandButton2_Click() 'Rename button


a = 1
If Not Files Then
MsgBox "Filename missing", vbCritical 'Errormessage
Exit Sub
Else
ForEnd = UBound(Files)
ReDim NewFiles(UBound(Files)) As Variant
End If


Keep up the good coding - it is the best I've seen on DZ.COM

For the same reason I jump off a perfectly good diving board.

Share this post


Link to post
Share on other sites

I never thought of that problem.

You are right, all i need to do is move down the ReDim and find out if UBound(Files)>0

I dont know if you are thinking the same as me, but i could use the same If-statement as TextBox1.value="", right?
I mean:



If UserForm1.TextBox1.Value = "" Or UBound(Files)=0 Then
MsgBox "Filename missing", vbCritical 'Errormessage
Exit Sub 'Stop macro
End If


Filename missing can mean two things:P
And i dont have to make another If, which would slow down the code (very litle).

I will might have some time to work on it tomorrow, need some sleep now.

Share this post


Link to post
Share on other sites
Won't work. You will get a type error on UBound(files) since it will still be a variant or boolean type and not an array.

I'm not that smart - I first tried exactly what you were thinking and it didn't work.
For the same reason I jump off a perfectly good diving board.

Share this post


Link to post
Share on other sites
Yep noticed, but i could do a IsArray(Files).
Thank you for the help!

Ok have a copy-option aswell now.
As always do a dummytest first on txt-files. I have not yet managed to get it to fail, but please try on txts first.

News:

* Buttons change color depending on if you are "done".
* Fixed a MAJOR problem with undo-button (PLEASE DONT USE OLDER VERSIONS)
* The files 'should' have a digital signature, this should let you choose to always permit the file to be opend with macros enabled.
* The Undo-button ONLY works when you renamed files, not when you copy them.

The button 'Copy' and the button 'Rename' are placed on top of each other.
To use the Rename button simply leave the destination folder empty.
To use the Copy button, use the Destination button and choose a destination folder.
The rename button will disappear and copy button will be visible.
To get rename button back, remove destination folder.

When you choose a folder you can either choose a existing folder, or right click to create a folder, or choose the parent folder and type in the name of the folder you wish to create in the textbox.


As always, tell me about bugs or any changes that needs to be done.
Hope this helps you Mark.

Share this post


Link to post
Share on other sites
Could a moderator please edit post no 4 in this thread.
Just make a edit saying 'dont use this version, use the last posted version please.' or something?
I know there are 'issues' with the older versions that could result in (not very serious) crashes.

The only thing i think can be slightly problematic is the older version of the Undo-button, but still, latest version is the best.

Share this post


Link to post
Share on other sites

Your code keeps getting better :)The only tweak I would recommend is to make the UNDO button disabled until you have copied something. If you click on the undo with copying something first, you get an error. You could prevent the error by modifying the CommandButton3_Click() subroutine to include :

If IsArray(OldFiles) Then

. . .

endif

It would be more elegant to disable the UNDO and add

UserForm1.CommandButton3.Enabled = True

to your CommandButton6_Click() subroutine and a UserForm1.CommandButton3.Enabled = False to your CommandButton3_Click() subroutine so the user doesn't try to UNDO more than once.


If at any time you think I am being a jerk and hypercritical of the code, just tell me to shut up.

For the same reason I jump off a perfectly good diving board.

Share this post


Link to post
Share on other sites

I love that someone comments the code!
And thank you very much for bugtesting it.

Yet again you found a bug i didnt think of. :$
Its not a big bug but i MUST be fixed.
I see your point, but the undo-button are not supposed to work with copying, only when just a rename has been done.

When i tested the copy on some videofiles i noticed i really wanted a progressbar.
My motto in software development is that nothing is impossible, its just harder to accomplish.
But i do belive this will be very hard since im leting windows take care of the actual copy-part.

I dont know if you noticed the problem with the old undo.
I just had one of them moments, i never tried if the bug really existed but im quite sure it can be done.
DONT DO THIS
If you rename files the undobutton will rename the files back to what it used to be.
But if you would rename, then select new files, and then hit undo. I belive you would rename the wrong files.
And thats because the array Files() are used in both cases.
And thats the reason i have Files(), OldFiles() and NewFiles().

I think we should have a development forum at DZ.com, there is a lot of technology and computers in the sport.

I will fix it tomorrow morning.
Thanks again for the input, i really appreciate it.

EDIT: oh, forgot one thing, did the digital signature work?
It should (in theory) give you a option to trust the file so that it will always open with macros enabled

Share this post


Link to post
Share on other sites

Fixed a few bugs with the creating folders part of the code.

It will not crash if you want to create more than one folder at the time anymore.
Also added a "check if drive exists" code to make it more stable.
And since its easter... ;)B|
No cheating

Share this post


Link to post
Share on other sites

Two bugs found and fixed, and one new (useful?) feature added.

Bug 1: The program did not allow you to not chose a destination folder (preventing you from closing window), Fixed.
Bug 2: When copying smal files the program crashed due to filesize beeing to smal, Fixed.

The new feature is a description txt file.
So when you rename/copy files you can create a file with a description of what the files contain.
The filename of this description file will be the same as the rest of the files but without "_##".

Example: you name the files "4-way April 2010".
And in the description file you could type what happens in this set of files such as "Malfunction in file 3 @ 2 min, waterlanding file 5 @ 3 min".
The stuff you know you have on video but dont know where :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0