Is there a native function for this within Access? Or would I have to do this with a batch script somehow?
Moreover, could I rename the files in a directory based on fields in an Access table?
See Dir function in VBA help to show you how to loop through a folder looking for files. Note that you must be in the VBA editor to search VBA help.
See the Name statement which "Renames a disk file, directory, or folder."
Is there a native function for this within Access? Or would I have to do this with a batch script somehow?
If you add the Microsoft Scripting Runtime as a reference you can use FileSystemObject
from VBA. See here for some good examples.
Moreover, could I rename the files in a directory based on fields in an Access table?
You can do this with VBA.
FileSystemObject
but as Tony points out you can use Name
. So all the functionality is built into VBA.
Jun 13, 2011 at 0:30