title: VBScript End of instruction copying DLL files
body: <p>I'm trying to code a DLL updater that just copies the new versions of some already existant DLL files to my working folder. This is just to keep the DLLs updated as my coleagues release new versions.</p>
  
  <p>This is the code I came up with after reading some tutorials.</p>
  
  <pre><code>Dim strSourceFolder, strDestFolder
  strSourceFolder = "C:\Users\myName\Desktop\Win64"
  strDestFolder = "C:\Program Files\Common Files\Company\Pruebaupdater"
  
  For Each file In StrSourceFolder
      If File.Type = "dll" Then
          ReplaceIfNewer
      End If
  Next
  
  Sub ReplaceIfNewer (SourceFile, DestFolder)
      Dim filesys, demofile, date1, date2
      Set filesys = CreateObject("Scripting.FileSystemObject")
      Set demofile = filesys.GetFile("filename1")
      date1 = demofile.DateLastModified
      demofile = filesys.GetFile("filename2")
      date2 = demofile.DateLastModified
  
      If DateDiff("d", date1, date2) &gt; 0 Then
          **copy SourceFile** to SourceFolder
      End If
  End Sub
  </code></pre>
  
  <p>When the script reaches the copy function, I get an 800A0401 at line 21 character 20 - End of instruction expected. This copy function is right the same in every bit of code I've seen.</p>
  
  <p>One of my sources is <a href="https://stackoverflow.com/questions/2832602/vbscript-compare-and-copy-files-from-folder-if-newer-than-destination-files">this</a> and there's no comment there as of the copy function, so I guess this works for them.</p>