September 1st 2010 – Version (2.3 Beta) is available. It adds the following new features:

  • A “Dry Run” mode. In this mode the application will only display and log the changes to the file/directory names without actually renaming the files and directories. This gives the user the ability to get an idea about what will be done before taking the plunge.
  • Fixes a bug where if a file or directory name contains only special characters, the renaming will fail and the recursive algorithm would try to keep going.

June 24th 2010 – Version (2.2 Beta). It adds the following new features:

  • Special characters could be removed from directory names as well.
  • It could be run in recursive mode that will allow renaming of all files and/or directories in all the sub-directories.
  • Removing all the dots in the file names but the last one that indicates the file extension.
  • The underscore is no longer considered a special character and it is not removed from the file names.


A few years ago I wrote a small application to remove all special characters from the file names of all the files in a directory.

Very often I would get a bunch of files that needed to be posted on a website and most of them would contain all kinds of special characters. I got fed up doing it manually- file by file, so I wrote this small app.

This is a Windows application written in C++ and works with win 98 and up. Of course Linux does not need anything like that, since you can do this with a quick one line shell command.

It only works with ASCII file names (sorry if you use any other language than English). I could have just as easily wrote it for UNICODE, but I had no need for that.

So, I decided to share it with anyone who wants to use it:

New v.2.3b: RenameFiles ver.2.3b
Old v.2.2b: RenameFiles ver.2.2 b
Old v.1.0:RenameFiles ver.1.0.

It is just a simple executable and does not need any installation. Keeping it simple is the key here. It also creates a log file in the same directory that the executable is in. The log file keeps track of the original file names and the new file names, so you can always find out what was done.

Quickly remove special characters from file names

118 thoughts on “Quickly remove special characters from file names

  • July 20, 2016 at 7:02 am
    Permalink

    I am using v2.3b with Windows 10. I have the same problem as several others. I want to remove : colon characters from ASCII file names. The preview shows the file names After Change as I would expect them. If I untick the Dry Run box it says it cannot find most of the files, cause = 3. What does cause = 3 mean? One answer said the files could not be renamed because the files were in use. That cannot be right. I have had the same problem on two external drives. On the second I used the Windows safe recovery tool immediately after the errors. It said the drive could be removed, so it was not in use. Also the error message said not found, not in use. More importantly the log shows that the errors occurred BEFORE the change. The first time I tried on the second drive it did rename 11 files. There is then a single error line in the log, and no log for the names After Change. Subsequent attempts also showed only a single error in the log, even though a dialogue box appeared for every file in the directory and said it was not found. I can email the log if it will help.

    A more minor error is that it removes – minus/hyphen characters even though they are permitted.

    It would be a useful program if it worked.

    Best wishes
    Richard

  • July 20, 2016 at 10:06 am
    Permalink

    Is there a limit on the length of a file name which the program will handle? A file name with 54 characters was successfully renamed. A file name with 71 characters was not found.

    Version 2.3b with the preview stops renaming after the first error, although it continues to create dialogue boxes saying a file cannot be found. The earlier versions continue to rename files after errors, so they will rename a few more files.

  • July 20, 2016 at 6:39 pm
    Permalink

    In case it makes a difference I should add that both drives are formatted as FAT32.

  • September 3, 2016 at 6:01 pm
    Permalink

    I thought this was precisely what I was looking for, but discovered it doesn’t do what I needed – I’ve got a colon (:) in a file that came from Linux, and am trying everything to find out how to fix this. Here’s my log, ran into an error, reason 3. Dunno what that means, but you probably will!

    ——————————

    16:58:45 – 09.03.2016

    ——————————

    G:\

    ——————————

    File Names Before Change:

    ————————-

    G:\\$RECYCLE.BIN\

    G:\\2016-07\

    G:\\E-Books\

    G:\\RenameFiles2.3b.exe

    ————–ERROR——————Current directory: G:\File Screenshot – 07312016 – 12:10:47 PM.png not found, cause = 3

  • March 10, 2017 at 11:57 pm
    Permalink

    Thank you!
    I needed to port many thousands of files from Dropbox to OneDrive & OneDrive doesn’t allow the special characters that dropbox does. I downloaded the Dropbox files, ran this program against them, then uploaded the files to OneDrive. It helped me out immensely.

  • May 18, 2017 at 5:12 am
    Permalink

    Hi Dimitar,
    Nice program. Some suggestions:
    – Make the result screen resizeable
    – Make it optional to allow common special characters like underscore ( ), dash (_), minus (-) and so on
    I have a many many thousands of files and just want to find the very bad filenames.
    Chris

  • June 19, 2017 at 11:15 am
    Permalink

    This works well . . . thanks!

    Suggestion for an enhancement.

    Allow user to provide their own string fragment to remove.

    For example, “%20″….

  • September 20, 2017 at 5:13 pm
    Permalink

    Thanks for the great utility!
    One suggestion: a checkbox for showing only the filenames that will be changed.

  • September 26, 2017 at 4:20 pm
    Permalink

    I cannot thank you enough for this utility. So many stupid users can’t follow directions but I have to migrate their data. in 5 minutes I had hundreds of files handled whereby before I spent hours cleaning up.

  • November 19, 2017 at 9:51 am
    Permalink

    I like chris have the same request

    Nice program. Some suggestions:
    – Make the result screen resizeable
    – Make it optional to allow common special characters like underscore ( ), dash (_), minus (-) and so on
    I have a many many thousands of files and just want to find the very bad filenames.
    thanks
    Dean

  • June 4, 2018 at 7:41 am
    Permalink

    Thanks for such a great utililty!
    It helped me for years on end from Windows XP to Windows 10.
    Nothing to install and works like a charm.. Keepup the good things!

  • November 6, 2018 at 1:30 pm
    Permalink

    any update from beta?

  • December 9, 2018 at 6:38 pm
    Permalink

    I have a file with ASCII CHAR 24 in the file name that I cannot rename. This is the log…

    ——————————

    DRY RUN ONLY

    ——————————

    18:34:06 – 12.09.2018

    ——————————

    H:\GARMIN\ACTIVITY

    ——————————

    File Names Before Change:

    ————————-

    H:\GARMIN\ACTIVITY\C8A3739.FIT

    ————————-

    File Names After Change:

    ————————-

    H:\GARMIN\ACTIVITY\C8A3739.FIT

    ——————————

    18:34:20 – 12.09.2018

    ——————————

    H:\GARMIN\ACTIVITY

    ——————————

    File Names Before Change:

    ————————-

    ————–ERROR——————Current directory: H:\GARMIN\ACTIVITYFile C8A3739.FIT not found, cause = 3

    Thoughts?

  • December 21, 2018 at 1:43 pm
    Permalink

    I rarely comment but this program saved me so much time and effort. I have some suggestions of my own and after reading some of the comments. I don’t know how the program works and am not a programmer. I really love this program you made against all others. I have spent so much time looking for this exact thing.
    I would comment, not as a critique but to try and be helpful. It might be easier and less work to find what is allowed and eliminate the bad(just a few letters) Possibly just a .txt file that the users can edit. Or a quick list of what was found with a checkbox set to remove it or not (uncheck to allow) possibly saving a permanent allow list to an editable origional text list so individual people can choose to their own application.

    You could also probably truncate long filenames to (variable) 8 char, with the origial filename saved to Comment in header or something.
    I hope this helps 001% as much as you have helped me.

  • October 17, 2019 at 11:35 am
    Permalink

    Are their any android apps to delete or rename filenames that are invalid in windows? Because bluetooth transfers fail AND windows is so stoopid it transmits a whole batch then fails the entire transfer for even 1 file with 1 invalid character.

    Thanks

  • May 17, 2020 at 10:47 am
    Permalink

    would be grealy appreciated if you add the option to remove the sequence or numbers from the file name

  • September 1, 2021 at 4:09 pm
    Permalink

    Hi Dimitar I have a text file that ends with non ASCII character. Is there one line to remove it.
    findstr /v /i /L /c:”life” trivia.txt > triviaz.txt – works fine
    findstr /v /i /L /c:”?” trivia.txt > triviaz.txt – doesn’t work 🙁
    trivia.txt content
    … Sudoku game #’s
    5..3.7..4.4.2..13..3.4.92..9…3..484..5..91.6..8.4.7.25…3.8.8..62.3….1.48.2.
    .41..57….2.4..69..6.8.12.41…2.8.82….9.6.7..9..411….6.73.3871….56…84..
    ???????????????????????????????????

  • January 5, 2023 at 5:45 am
    Permalink

    It doesn’t work.

    I have a folder with 7000+ files all with extended (Japanese) characters in the filenames, and processed the folder with this application. It gave a “not found” dialogue for every single filename. I had to hold down the escape key for about five minutes to get through them, then the application just closed and nothing had changed.

Leave a Reply

Your email address will not be published. Required fields are marked *

*