Copy several file in vbs

VBS script to copy one single file or several.

Const OverwriteExisting = True
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
objFSO.CopyFile “C:\source\monfichier.txt” , “D:\Archive\”, OverwriteExisting

For several files:

Const OverwriteExisting = True
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
objFSO.CopyFile “C:\source\*.txt” , “D:\Archive\”, OverwriteExisting

 

Leave a Reply