Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a directory which contains sub folders which contain files with very diverse names from many different users so they are not named very consistently. I am moving this directory to a sharepoint site which does not allow certain characters as file names because the way it was designed they are reserved characters.

Invalid chars: " # % & * : < > ? \ / { | } ~

Referenced from: http://www.thesug.org/mossasaurus/Wiki%20Pages/SharePoint%20Invalid%20Characters.aspx

As you can see there are many chars which I would have to look for, I could tear through the many folders and hundreads of files hunting for each invalid char by eye, but is there a faster way can I go about searching the master folder which contains sub folders as well as their contents for each or every one of these chars so that only the folders and files with the bad chars show up?

Thank you for your time,

share|improve this question

2 Answers 2

up vote 2 down vote accepted

This ought to do the trick for you:

dir *#* *%* *^&* *{* *}* *~*  /s /b > bad_file_names.txt

This should pick up the files with bad characters and dump them in a neat little text file list. I omitted the characters that should already be invalid on Windows (I assume you're running Windows what with the SharePoint server).

share|improve this answer

Try something like Agent Ransack or WinGrep to search for the Regular Expression pattern:

["#%&*:<>?\/{|}~]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.