Copyright MonkeyJob Systems 2005
All rights reserved

Home FAQ Forums Contact
Download Tutorials FAQ Awards Report Bugs
 Search For Data

I need 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


Target the root folder that contains your files. Use the folder tree on the left pane of the filemonkey main window to find the folder that your files and sub folders are in. 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:

file name pattern


Once you have targeted your files, select the "Quick-Find, Command Line" menu item from the main window.


The Create/Run batch file window should now be open

make batch jobs

load batch jobs

Load Script


From the menu bar at the top of this window, select the "File / Load Code" menu item.


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 Replace Files With File.FM and click the "Load" button.


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"

Replace Files With Source File


We have entered the file "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"


To start the operation, select the "File/Compile And Run" menu item.
Related Topics:
FileMonkey Tutorials
Frequently Asked Questions
FoldMonkey - Create folders and or copy or move files.

  | About Us | Privacy Policy | Terms Of Use | Affiliates | Forums | Copyright 2003 MonkeyJob Systems All Rights Reserved |