How does it work?

Visual Studio maintains a list of special dynamic link libraries (DLLs) known as add-ins. When it starts, Visual Studio loads all known add-ins and incorporates them into its normal command set. In this way, Witzend Replace in Files becomes a new Visual Studio command.

Installation fails with “Can’t create temp file” or “Can’t register component” error

These messages can appear under later versions of Windows, and almost always indicate the operating system believes you lack sufficient privileges to install the ReplaceInFiles component. Close the Setup installer program, then run again by right-clicking in File Explorer and selecting “Run as administrator” from the menu. For the evaluation version, this might mean downloading the Setup installer program again, this time opting to save the file to disk instead of asking your browser to run it.

I don’t see the Witzend Replace in Files command after installing

By default, the command appears at the top of the Visual Studio Tools menu. If you don’t see it there after successfully installing the component, invoke the Add-in Manager from the Visual Studio Tools menu, then find Witzend ReplaceInFiles Add-in in the list of available add-ins.

When you start Visual Studio after installing the component, the first two check boxes should already be marked. (Once the Witzend Replace in Files command is correctly inserted into the Tools menu, you can turn the check boxes off if you wish. This prevents the ReplaceInFiles Add-in from loading until the command is invoked.)

If the two check boxes are not marked, set them and restart Visual Studio. If the Witzend Replace in Files command still does not appear on the Tools menu, reset the environment as described below, then run the ReplaceInFiles Setup program again to re-install the component.

Can I move the command from the Tools menu?

Sure. The Witzend Replace in Files command can be moved to another menu or to a toolbar. Like any Visual Studio command it can be copied—not just moved—so you can access to it from various locations. As an example, here’s how to move or copy the command from the Tools menu to the Edit/Find and Replace submenu:

1. On Visual Studio’s Tools menu, click Customize to invoke the “Customize” dialog.

2. While the “Customize” dialog is visible, expose the Tools menu.

3. Drag the Witzend Replace in Files command from the Tools menu to the Edit command on the menu bar to expose the Edit menu. Still dragging, set the mouse cursor on the Find and Replace command to expose the submenu.

4. Drop the command at the desired location the submenu. If you want to copy, rather than move the command, press the Ctrl key while releasing the mouse button. This duplicates the command so that it appears both on the Find and Replace submenu and in its original position on the Tools menu.

Using the same technique you can move or copy the command to a toolbar. Make sure the destination toolbar is visible before invoking the “Customize” dialog. By default, Visual Studio includes the command text on the toolbar, which you may prefer to do without. While the “Customize” dialog is still on the screen, right-click the new Witzend Replace in Files command on the toolbar and select Default Style from the pop-up menu to remove the text. When the command appears on the toolbar the way you want, close the “Customize” dialog.

A message appears saying “This Add-in cannot be loaded” when I click the command

The message may appear when you first invoke the Witzend Replace in Files command, and indicates the operating system doubts your user credentials. Solve the problem by exiting Visual Studio, then restart by right-clicking the Visual Studio command and selecting “Run as administrator” from the menu. If you don’t have sufficient rights, ask your system administrator to perform the task for you. You need do this only once. Thereafter, Visual Studio should start the add-in without further complaint.

I changed some registry settings and now the command no longer appears

No worries. The safest solution is to reset the environment and then re-install the ReplaceInFiles Add-in using the Setup program installer you received from Witzend Software. To reset Visual Studio, open a command window and execute Visual Studio from the command line using the appropriate argument:

Version Command
Visual Studio 2002 and 2003 devenv /setup
Visual Studio 2005 and higher devenv /ResetAddIn WitzRepl.Connect

Then re-install the ReplaceInFiles Add-in.

If you work with Visual Studio 2002 or 2003, bear in mind that the /setup argument causes Visual Studio to remove all add-ins from its command set, not just the ReplaceInFiles command, forcing you to re-enable them in the Add-in Manager after the reset.

How do I clear the ReplaceInFiles history lists?

The Witzend ReplaceInFiles Add-in remembers the words and phrases you type during search-and-replace operations, collecting them in separate history lists. Clicking the arrow button adjacent to any combo box on the dialog exposes the corresponding history list, allowing you to select a previous word or phrase without having to retype it.

ReplaceInFiles stores the history lists and other settings in a small INI file, located in your user’s data area. You can navigate to the folder using File Explorer or any equivalent tool, setting the path


The INI file format is normal text, so you can edit it using your favorite text editor. Use care when editing, of course. Best to first make a back-up of the file in case your changes aren’t what the ReplaceInFiles Add-in expects.

The easiest way to reset your settings and clear the history lists is to simply delete the INI file. The next time you invoke the ReplaceInFiles Add-in, it will automatically create a new INI file and populate it afresh with your new selections.

Note that an INI file also exists in the same folder as the WitzRepl.dll add-in module itself. That file serves merely as a template, and is not used to store user settings.

There are no files listed in the Location tab

The list can be empty for two reasons, depending on whether you have selected Browse or Project view in the Location tab. In Browse view, an empty file list simply indicates there are no files in the selected folder that conform to the current filter. Select “All Files“ in the filter combo box to list every file in the folder. If the file list remains stubbornly empty, it merely indicates the folder contains no files. This doesn’t mean you can’t conduct a search, since ReplaceInFiles can search into nested subfolders.

The file list in Project view is also winnowed by the selected filters. Thus the list is empty if current filters screen out all candidate files. The list is also empty if you have no solution open in Visual Studio, since there are in this case no files in the Solution Explorer.

I updated to a new version of Visual Studio and now the Witzend Replace in Files command no longer appears

Visual Studio does not automatically migrate add-ins when it updates, so you must manually re-install ReplaceInFiles to inform the new Visual Studio of the add-in’s presence.

Make sure Visual Studio is not running, then execute the Setup installer program to re-install the Witzend ReplaceInFiles Add-in. This updates registry settings so that your new Visual Studio can locate the add-in. You should accept the installer’s suggested location to ensure your current settings and history lists remain unchanged.

If you have moved the command to another menu or toolbar, you may have to reset its position again as described above.

How do I get context-sensitive help under later versions of Windows?

The ReplaceInFiles context-sensitive help is invoked either by clicking the small question-mark button on the dialog’s title bar or by selecting a dialog item and pressing the F1 key.

Under earlier versions of Windows the pop-up help balloon was handled by the Windows Help program WinHlp32. However, since WinHlp32 is no longer available under current Windows, ReplaceInFiles uses a custom service developed by Witzend Software to accomplish the same feat. This ensures context-sensitive help is always available regardless which version of Windows you use.

Witzend Software