Link to home
Start Free TrialLog in
Avatar of IT CAMPER
IT CAMPERFlag for United States of America

asked on

Script to Rename files

I need a turnkey Windows script to rename all the files inside a folder in sequential order.  It does not matter the current filename or even the order of the files.  I just need all 5k audio files to be renamed to SP0000.wma, SP0001.wma, SP0002.wma, etc  Most of the current filenames have spaces in them.
Avatar of dec0mpile
dec0mpile
Flag of United States of America image

Have you ever used this tool?

http://www.bulkrenameutility.co.uk/Download.php

This is what I use when I need to so such tasks. It comes with great deal of features and it is very flexible (can handle large amount of files).

Just as a reminder, weather you use script or a tool you should always make a backup of your files before you perform automated bulk operations on them.
Avatar of Bill Prew
Bill Prew

What do you mean by "5k audio files"?

~bp
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IT CAMPER

ASKER

billprew...I have around 5 thousand files to rename

dec0mpile...I will review
Ah, I get it, just the count of files.  Okay, then my script should be a good starting place, maybe doing everything needed.

~bp
bp, I executed the script but it just runs with no error or output.  I will wait and run it against your other script that extracts the audio files into a single folder.
Well, I ran a test here and it renamed the files.  What did you change the first 2 lines to?

~bp
strBaseDir = "D:\KKUS Tom Music"
strBaseExt = ".wma"
Inside the "D:\KKUS Tom Music" do the files that exist have an extension of ".wma"?  That is the assumption in the script.  Or do they have some other name?

And the files are NOT in subfolders, right?

~bp
The are in subfolders, BUT they will all exist in the root once I run your other script (on the other question) to extract them.  They are all .wma but there are also other misc files just .jpg files mixed in there.  Those files just need to be left alone.
Okay, I get it, so this script shouldn't have done anything yet, fair enough.

~bp