Tuesday, April 22, 2014

vbscript copy files from a folder

dim objFolder
dim sFolderName
dim objFiles
dim objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
sFolderName = "E:\Program Files\Indicator Files\OCDInfo\"
if (objFSO.FolderExists(sFolderName)) then

 set objFolder = objFSO.GetFolder(sFolderName)
 set objFiles = objFolder.Files
  For each objFile in objFiles
   objFSO.CopyFile objFile.Path, "E:\dest\" & objFile.name
 Next
else
end if

No comments:

Post a Comment