Batch File to replace one character in a filename with another character
Consider using a free GUI app to hold your hand: http://www.bulkrenameutility.co.uk/Main_Intro.php
If you must this yourself with a batch file, be super careful! Batch scripts don't have an "undo" button. If you execute your bat script which applies to all files recursively under somewhere like
C:, you've just renamed every file on your computer and it will immediately stop working and fail to boot. You'll have to do an full OS reinstall. Always have a backup!
First you'll have to decide do you want the batch file to work on a single file? To work on all files in a directory? Or do have it done recursively (all files/folders under a directory). Here are some pointers:
Batch file to replace all underscores
_ with the letter
M to all files in current directory
Put this in a batch file named
for %%a in (*_*) do (
ren "!file!" "!file:_=M!"
Execute it, and all the files in that directory with an underscore will be changed to an 'M'.
Use a Batch File to replace spaces with nothing (removing the spaces):
Use a Batch File to replace spaces with underscores, Recursively: