title: Script to screen folder for "illegal" characters
body: <p>In order to share files and folders in SharePoint I have to make sure folder and file names don't contain illegal characters, otherwise the file transfer just stops without transferring the rest of the files.</p>
  
  <p>I have searched for solutions using VBA and CMD scripts, but I can't seem to find something usable for my exact situation. </p>
  
  <p>Using Windows 7 Explorer search option seems to do the job, but then I'd have to make a search for each of the 12 characters (# % &amp; * : &lt; > ? / { | }) for each folder which is very time consuming.</p>
  
  <p>Instead, I'm thinking VBA with something like</p>
  
  <pre><code>sub Screenfolder()
  
  Dim myValue As Variant
  myValue = InputBox("Path to screen")
  Range("A1").Value = myValue
  
  For Range("A1")
      If file/folder name contains # % &amp; * : &lt; &gt; ? / { | } then
      Replace "filename#&amp;{" with "filename123"
      else
      Endif
  Next
  
  End Sub
  </code></pre>
  
  <p>I am aware, that the code probably is going to be a lot more complex, but this is the form I'm thinking.</p>
  
  <p>Is it possible using VBA or CMD? </p>