Renaming strings in multiple files

I have a software that creates a network of workstations by naming the files in a folder with the network address and workstation address, each is 2 digits. Recently we have been needing to go in and update these to a more organized format, and in order to do so, I have to go into the folder and rename the files to the network/workstation address that I want it to be and then update the .ini file with the updates addresses. There are about 10-15 files in the folder that have to be renamed, and their example formats are:
WS0203.db
ExFile03.db3

Some of the files have the network AND workstation addresses and some just have the workstation address.

What I am looking for is a command (or maybe a script is the better way?) where I can run it on a particular folder to rename all files with β€œ0203” to β€œ0410” and rename all files with β€œ03” to β€œ10” so it would be quicker. The updated files from above would then look like:
WS0410.
ExFile10.db3

Some of the time I am having to do all this on touch screen at the station so its alot of tedious work that Im sure could be simplified. Any ideas?

Jayfaas19,
Welcome back to the forum. :wave:t4: … long time no see. :slight_smile:

Have you at least tried once to search for a solution? What you asked for is a very common task and it has been asked a lot of times already and it has been answered a lot of times already.

This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

Another option besides a script would be a file rename tool. They have a GUI and most of them are able to work with regular expressions.

Here you have a comparison of some of them:

Strangely, that article omits Microsoft’s own offering:

1 Like

I figured there were utilities out there. Was just hoping powershell had something to offer that I wouldnt have to install or carry around on a flash drive.

Some tools may be available as portable versions. You could run them from a network share if you like.