''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' EV script 004 - Add new data file location to all EV files in a folder ' Example Echoview COM script downloaded from www.echoview.com ' For support, contact the Echoview support team ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Option Explicit Dim FolderName: FolderName = "C:\MyFolderOfFiles\" Dim fso: Set fso = CreateObject("Scripting.FileSystemObject") Dim Files: Set Files = fso.GetFolder(FolderName).Files Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication") Dim File For Each File In Files AddLocation FolderName & "\" & File.Name Next EvApp.Quit ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' A subroutine to change location in a named file Sub AddLocation(FileName) If (UCase(Right(FileName, 3)) <> ".EV" Or UCase(Right(FileName, 12)) = " (BACKUP).EV") Then Exit Sub End If Dim EvFile: Set EvFile = EvApp.OpenFile(FileName) If EvFile Is Nothing Then MsgBox "Failed to open EV file '" & FileName & "'" Exit Sub End If EvFile.Properties.DataPaths.Add("C:\MyNewDataFilePath\") EvFile.Save EvApp.CloseFile(EvFile) End Sub