Removing Counter Names and Descriptions from the Registry

If you need to remove counter names and descriptions from the registry, use the unlodctr utility. This removes the registry entries made by lodctr.

Using unlodctr

The command-line syntax for unlodctr is:

unlodctr Application_Name

The unlodctr utility looks up the First Counter and Last Counter values in the application's Performance key to determine the indexes of the counter objects to remove. Using these indexes, it makes the following changes to the Perflib key.

HKEY_LOCAL_MACHINE
    \SOFTWARE
        \Microsoft
            \Windows NT
                \CurrentVersion
                    \Perflib
                        Last Counter = updated if changed 
                        Last Help = updated if changed 
                        \009
                            Counter = application text removed 
                            Help    = application text removed 
                        \supported language, other than U.S. English
                            Counter = application text removed 
                            Help    = application text removed 
 

The unlodctr utility also removes the First Counter, First Help, Last Counter, and Last Help values from the application's Performance key.

Note  The unloading function of UNLODCTR, UnloadPerfCounterTextStrings, is declared in LOADPERF.H and exported from LOADPERF.DLL. This allows you to call this function directly from your uninstall program. The syntax for this function is as follows:

LONG UnloadPerfCounterTextStrings(

LPSTR lpCommandLine,
BOOL bQuietModeArg
);

where lpCommandLine is the name of your application and bQuietModeArg is a Boolean parameter that indicates whether to display output during the unloading of the counter text strings. If the function succeeds, the return value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in WINERROR.H.