title: powershell remove last 3 characters from file name
body: <p>I need to recursively rename a bunch of files with the extension '.cop' (for copy) and get rid of that '.cop' string.</p>
  
  <p>I made the following command from what I read on the <code>get-help rename-item</code> topic:</p>
  
  <pre><code>gci -r -i *.cop | Rename-Item -newname {$_.name -replace '\.cop',''}
  </code></pre>
  
  <p>but I get an IO exception error :</p>
  
  <pre><code>Rename-Item : Cannot create a file when that file already exists.
  </code></pre>
  
  <p>PowerShell doesn't want to rename the file because it already exists? 
  that doesn't make sense... anybody knows what I am doing wrong here ?</p>
  
  <p>Thanks </p>