I have been trying to find a program that will find a file name in a directory and everywhere the file is listed to have it replaced with a newer file with the same name.
The following tutorial will demonstrate using the command line feature of FileMonkey to replace all files with a specific name, the same name, with a single source file.
For example, you could use this feature to find all files named list.txt and replace them all with a source file: C:\List.txt
1.
|
Target your files in the main window. Click HERE for a targeting tutorial.
As you are working on sub folders, tick the "Include Sub Folders" tick box and tick the "Include Hidden Folders" tick box.
You will also need to enter a file pattern of the file names that you are trying to replace. For example, if you want to replace all files named list.txt, enter a pattern of "list.txt" (without the encompassing quote marks). The bottom of the main window should now look like:

|
2.
|
Once you have targeted your files, select the "Quick-Find, Command Line" menu item from the main window.
|
3.
| The Create/Run batch file window should now be open
|

|
|
| |
Load Script
4.
|
From the menu bar at the top of this window, select the "File / Load Code" menu item.
|
5.
|
This will open the load file dialogue box.
Use this box to navigate to the folder that FileMonkey is installed in (This is usually something like: C:\Program Files\FileMonk)
Select the file ReplaceFilesWithFile.FM and click the "Load" button.
|
|
|
|
6.
|
Next, you need to enter the path of the source file that you wish to use.
In the "Head" section, find the following line:
set SourceFile="C:\myfile.ext"
|

7.
|
We have entered the folder "C:\myfile.ext" as the default source file. You may want to change this to something else.
Delete the text "C:\myfile.ext" and enter the file and path that you wish to use here.
You MUST keep the encompassing quote marks otherwise this operation may not work.
For example: If you wish to use the file C:\New Folder\List.txt then replace the line:
set SourceFile="C:\myfile.ext"
with the line:
set SourceFile="C:\New Folder\List.txt"
|
8.
|
To start the operation, select the "File/Compile And Run" menu item.
|
|