title: Window File Batch Rename from Spaces to Underscore
body: <p>I'm trying to use a batch to rename a file from "aaa aaa.doc" to "aaa_aaa.doc"</p>
  
  <p>I've written a script in the past to rename "aaa_aaa.doc" to "aaa aaa.doc"</p>
  
  <pre><code>@echo off
  setlocal enabledelayedexpansion
  for %%a in (*_*) do (
    set file=%%a
    ren "!file!" "!file:_= !"
  )
  </code></pre>
  
  <p>How to modify from " " to "_" and ignore special symbol?</p>