title: Overwrite a current file using VBS
body: <p>I have a pretty small VB script here that just trims a leading space off of file names for a given folder. The problem is when it runs it throws an error message if that same file name already exists. Is there a way to tell the script to overwrite a file if the file name already exists? Syntax below:</p>
  <pre><code>Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
  strFolderName = &quot;\\CORP***\***Share\Common\RFI Validation Outputs&quot;
  Set objFolder = objFSO.GetFolder(strFolderName)
  Set colFiles = objFolder.Files
  For Each objFile in colFiles
  objFSO.MoveFile strFolderName + &quot;\&quot; + objFile.Name , strFolderName + &quot;\&quot; + LTrim(objFile.Name)
  Next
  </code></pre>