title: Removing spaces in file names duplicate error
body: <p>I have the following script to remove spaces from file names:</p>
  
  <pre><code>@echo oN
  setlocal enabledelayedexpansion
  for /r %%j in (*.*) do (
  set filename=%%~nj
  set filename=!filename: =!
  if not "!filename!"=="%%~nj" ren "%%j" "!filename!%%~xj"
  )
  Pause
  </code></pre>
  
  <p>It works great, but I am running into an issue where there will be a duplicate file name when the spaces are removed and the file is skipped. I needed it to append a (2) to the file name (filename(2).doc).</p>
  
  <p>Can someone please help with this? Thanks</p>