SW Addin Registry Scrub Project file size: 18762 bytes

ABOUT RegScrubSWAddin Visual Basic Project
by Roland E.C. Schwarz

Sep. 16, 2004: Slight revision to code. I removed an unused subroutine that had an error that prevented the code from compiling into an .exe. Uncompiled run-time code still runs the same.

This visual basic project and its associated modules are distributed for the purpose of education. This is code that I wrote for my own use, and posted to share with other interested programmers.

I left the posted version of this code uncompiled. There are two reasons for this. Firstly, it is the purpose of this project to allow others to learn from the code. More importantly, it is because the code adds and removes data from the Windows registry. Mucking about with the registry can be a sensitive issue, and I thought it best to leave this project open source, so that the users may know just exactly what is happening.

Since this program is intended for programmers who are making SolidWorks addins, it is available only as a project file for the full version of Visual Basic 6. There will be no SolidWorks macro version published.


The purpose of this program is to clean out registry entries created by the compiling and installation of SolidWorks addins created with Visual Basic.

When the program is run, the first thing presented to the user is a form listing the addins presently installed in SolidWorks. The user enters the ClassID of the addin, either by selecting from athe drop-down list or manually. The manual option is available because the API functions that enumerate registry entries sometimes miss some entries.

The second step is to select toolbar information to delete. Leave blank and click "OK" if you wish to skip toolbar information. This program does not delete all of the toolbar information. I have not found a way to do this without causing seriou errors. Enough toolbar information is removed to eliminate toolbar availablility of a deleted addin from the SolidWorks user interface.

Once the addin information is entered, the program sorts through the registry and compiles a list of registry keys to delete. This can take several minutes, so be patient. The registry is a sizeable database. Once the list is compiles, a form is shown which lists the registry keys selected for deletion. The user can then delete all or some of the keys. There are also backup and restore functions.


The module "BaseRegistryUtes.bas" originated as a downloaded turorial from CodeToad, http://www.codetoad.com/vb_modify_registry.asp. I have left most of the original remarks intact. I also added some new functions and updated some that were using outdated API.