rename file for Windoze

:rolleyes: Help! I’ve got several folders containing at least 15,000 JPEG files in them.Most of these files have PC-friendly names but some filenames contain characters like £%&/?!^@ and so on. The next step is to put these onto a Windows server to be processed by an application, but before I can do that every file needs to be named in a PC-friendly way. So, I want to check the filename of each file and where they contain dodgy characters I want to change these characters to underscores.

Because of the amount of files in each folder, I’ve decided not to list the folder, but instead just have my script select the first file of the folder, do the name change and move it into a ‘done’ folder. However, the name change bit’s got me stumped. I’ve looked at the excellent RenameToWindows 1.2 but this is too complex for me and though I’ve tried I can’t isolate the bit I need to use.

I can identify the file I want to work on, and I can get its filename as text. I need to do some kind of find-and-replace on that text to tidy it up, and if I can get a text version of the new, cleaned filename I’ll be able to rename the file with it and move it to the ‘done’ folder. It’s just the find-and-replace characters bit that I’m totally stumped on. Help!