| || |
get all files in a directory
I would like to get all files in a specific directory, loop through all files and copy them to another folder. I was looking for a function in Build.in or Utility object but I could not find appropriate functiont to do what I want.
Re: get all files in a directory
If you want to copy files from one folder to another, you can use the BuiltIn.CopyFiles method. For example:
<font class="small">Code:</font><hr /><pre>
BuiltIn.CopyFiles "C:\Source", "C:\Destination", False
Please see the "BuiltIn.CopyFiles" help topic for more about the method.
Also, you can do this using the CopyFile method of the FileSystemObject OLE object.
Please see the following MSDN article for details:
To enumerate files located in a folder, you can use the FindFirst and FindNext methods of the Utilities object or the Files property of the FileSystemObject OLE object. Please see the "Utilities.FindFirst" and "Utilities.FindNext" help topics and the following MSDN article for details: