BATCH : Change special characters from filenames (é è à…)


Batch can properly manage any Ascii character, that is, characters with code below or equal 255. This is obvious, because the Batch code itself must also be written in Ascii.

@echo off
set remove=áéíóúÜü
set string=Aaá Eeé Iií Ooó UuÜüú It Works!
for /F "tokens=1-26 delims=%remove%" %%a in ("%string%") do (
   set newString=%%a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%%m%%n%%o%%p%%q%%r%%s%%t%%u%%v%%w%%x%%y%%z
echo "%newString%"


"Aa Ee Ii Oo Uu It Works!"

If the characters you want to remove are not Ascii (codes above 255), then a Batch program can not solve this problem.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s