I have a need for a quick and easy way to scan all file and folder NAMES within a directory to replace all instances on one character with another. There are several possibilities, all of them are on the "invalid for use" by SharePoint" list.
The reason for this being doing after the fact is that the collection of files and folders was created before we were using SharePoint and this problem kind of hit me by surprise. Only when I had repeated failures of a number of files did I check to see the problem. There are over 50,000 files and one of the "invalid characters" is "#" which appears in over a hundred filenames alone. If I had checked beforehand, we might not have moved everything to the Office 365 Setup but hindsight being 20/20 doesn't help now.
Searching for solutions brought up several possibilities, one of which is linked below. RR.exe at nicj.net (is already compiled) but I don't think it is recursive.
I was wondering if anyone else had ever run into this problem and maybe already has a solution. If I have to run a script for each character to be replaced, then that is what I will have to do. Since these filenames are already listed in the database software, I have to try to standardize my replacements so that when a Search looks for a file with a "#" in the name, I have to have a preset replacement list to provide people.
Instead of "&" the filename will have the entire word "and" and so on. "#" I was going to replace with "-" but any suggestions appreciated. SharePoint has a list of maybe 20 characters that can never be used and most never would be.
But some..... "?" ????
OR <<<< (for that matter "<" or ">"
) None of these can be used and if they were I have to replace them with something or the files will not Sync. This is the best I have found
and I don't think it is recursive.
NOTE! The "Duh" factor just set in
! Still not a complete solution and I am playing with the other "normal" ways but "dir *#*.*" when run from the top directory level does return valid instances of the improper files so I suppose "ren" might work as well?