Posted By

choasis on 12/23/09


Tagged

file copy duplicate vbscript


Versions (?)

Copy a file


 / Published in: Visual Basic
 

VBScript!

  1. Dim fso, newFile, tplFile, fPath
  2.  
  3. fPath = "C:\"
  4. tplFile = fPath & "tpl.txt"
  5. newFile = fPath & "export.txt"
  6.  
  7. Set fso = CreateObject("Scripting.FileSystemObject")
  8.  
  9. if fso.FileExists(newFile) then
  10. MsgBox "File already exists."
  11. else
  12. fso.CopyFile tplFile, newFile
  13. MsgBox "File copied."
  14. end if

Report this snippet  

You need to login to post a comment.